nostr icon indicating copy to clipboard operation
nostr copied to clipboard

Support for usage of multiple tags filters??

Open MTG2000 opened this issue 3 years ago • 8 comments

Hey there. I am trying to implement a commenting system with nostr, where I will add several tags to the event to mark for which post it belong, and what is its type. So on creation for example, I'm creating this kind of object:

content: "Hello Guys" created_at: 1658319264 id: "0fb317e89fd9b2ace07cc2cf63389e4dc5e1c741c1f2ea4d87daa67dfb73c2e7" kind: 1 pubkey: "e7fc0ac27ee230ca885e08bd3284006db84ec4ac4dba8ee80672148765abcf20" sig: "ee4d7aad7fad78fa318d5b8bc1fd18faeadbe997e3067ba84f992cd57db8289f829955943d0f65e0b33185c69f622a8a76b51f5b8e67cf8cd9c5d2662c941cf0" tags: [["h", "bolt_fun"], ["t", "Story comment"], ["i", "21"]] 0: ["h", "my_host"] 1: ["t", "post comment"] 2: ["i", "2111aav123"]

As you can see, I'm using three filters when creating the object: h, t, and i. So when I'm starting a new subscription, I'm construction this filter: pool.sub({ filter: { "#i": ["2111aav123"], "#h": ['my_host'], "#t": ['post comment'] }, cb:()=>{...}

But it's returning nothing at all... Note that when I use only 1 filter of any of the above, it returns the events, but whenever I use more than 1 it returns nothing.

I'm not sure if maybe I'm constructing the filters object incorrectly, or if multi-tags aren't supported, or if it's something else...

Any help is appreciated. Thanks

MTG2000 avatar Jul 20 '22 13:07 MTG2000