nips icon indicating copy to clipboard operation
nips copied to clipboard

AND Filters

Open dskvr opened this issue 1 year ago • 1 comments

There have been a number of discussions about this topic, and it's even been implemented in a PR to nostr-rs-relay. I published a gist 3 months ago with the hopes someone would pick up where I left off, but nobody has.

tldr

filters: {
  "kinds": [1],
  "&t": ["meme", "cat"],
  "#t": ["black", "white"]
}
// returns kind `1` events with `t` tags that have both "meme" and "cat" that have the tag "black" or "white"

Resources

Rationale

  1. Makes filters more powerful/intuitive
  2. Optimizes bandwidth
  3. Potentially optimizes relays
  4. Potentially optimizes client development

dskvr avatar Jun 07 '24 10:06 dskvr

Making AND available only for tag queries makes sense in my mind.

vitorpamplona avatar Jun 07 '24 21:06 vitorpamplona