From 7ec427190822b0c61446b678b37c86c98c9beea6 Mon Sep 17 00:00:00 2001 From: Sandwich <299465+dskvr@users.noreply.github.com> Date: Tue, 3 Mar 2026 17:36:57 +0100 Subject: NIP-91: AND operator for filters (Formerly NIP-119) (#1365) Co-authored-by: dskvr --- 91.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 91.md (limited to '91.md') diff --git a/91.md b/91.md new file mode 100644 index 0000000..7ac15ae --- /dev/null +++ b/91.md @@ -0,0 +1,18 @@ +# NIP-91: AND Operator in Filters + +Enable `AND` within a single tag filter by using an `&` modifier in filters for indexable tags. + +``` +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" +``` + +## Rules + +- `AND` **MUST** take precedence over `OR` +- Tag values used in `AND` **SHOULD NOT** be used in standard `OR` tags [`#`] +- Any tag value used in `AND` **SHOULD** be ignored in `OR` -- cgit v1.2.3