diff options
| author | Sandwich <299465+dskvr@users.noreply.github.com> | 2026-03-03 17:36:57 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-03 08:36:57 -0800 |
| commit | 7ec427190822b0c61446b678b37c86c98c9beea6 (patch) | |
| tree | 219e47f017d926bb0683f223c98a9e026ab62339 /91.md | |
| parent | eeb532b5ff936a48caaef8b7540342e0b6795166 (diff) | |
NIP-91: AND operator for filters (Formerly NIP-119) (#1365)
Co-authored-by: dskvr <dskvr@users.noreply.github.com>
Diffstat (limited to '91.md')
| -rw-r--r-- | 91.md | 18 |
1 files changed, 18 insertions, 0 deletions
| @@ -0,0 +1,18 @@ | |||
| 1 | # NIP-91: AND Operator in Filters | ||
| 2 | |||
| 3 | Enable `AND` within a single tag filter by using an `&` modifier in filters for indexable tags. | ||
| 4 | |||
| 5 | ``` | ||
| 6 | filters: { | ||
| 7 | "kinds": [1], | ||
| 8 | "&t": ["meme", "cat"], | ||
| 9 | "#t": ["black", "white"] | ||
| 10 | } | ||
| 11 | // returns kind `1` events with `t` tags that have both "meme" and "cat" that have the tag "black" or "white" | ||
| 12 | ``` | ||
| 13 | |||
| 14 | ## Rules | ||
| 15 | |||
| 16 | - `AND` **MUST** take precedence over `OR` | ||
| 17 | - Tag values used in `AND` **SHOULD NOT** be used in standard `OR` tags [`#`] | ||
| 18 | - Any tag value used in `AND` **SHOULD** be ignored in `OR` | ||