jb55 on Nostr: thinking about adding a "filter" to nostrdb's query interface. basic idea is that you ...
thinking about adding a "filter" to nostrdb's query interface. basic idea is that you can provide additional filtering or reducing logic in any nostr query.
I like this better than setting a large limit and filtering after. you can just let #nostrdb do it while it scans the index.
I want to use this for ignoring thread replies, which is useful for building ai algos that try to summarize the past day or specific days, etc.
In the future we could support a jit-compiled jq-style language and use that in the callback:
{"kinds": [1], "filter": "not tag('e')[2] == 'reply'"}
#asknostr if you are a nostr dev, would you use this? what would you use it for?
Published at
2025-04-08 22:18:56Event JSON
{
"id": "086ccb1873fa10d4338713f24b034e17e543d8ad79c15ff39cf59f4d0cb7a2d6",
"pubkey": "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245",
"created_at": 1744150736,
"kind": 1,
"tags": [
[
"client",
"Damus Notedeck"
],
[
"t",
"nostrdb"
],
[
"t",
"asknostr"
]
],
"content": "thinking about adding a \"filter\" to nostrdb's query interface. basic idea is that you can provide additional filtering or reducing logic in any nostr query.\n\nI like this better than setting a large limit and filtering after. you can just let #nostrdb do it while it scans the index.\n\nI want to use this for ignoring thread replies, which is useful for building ai algos that try to summarize the past day or specific days, etc.\n\nIn the future we could support a jit-compiled jq-style language and use that in the callback:\n\n{\"kinds\": [1], \"filter\": \"not tag('e')[2] == 'reply'\"}\n\n#asknostr if you are a nostr dev, would you use this? what would you use it for?",
"sig": "c1ab17466eefeb9576623bacccfa8013778b52d20f386e336a5db49b9a02921a68ee833eced4b93e364d3e1442f3ceaaef13a7dcc52eadcb3f39eebfbdd43c4a"
}