diff options
| -rw-r--r-- | 91.md | 18 | ||||
| -rw-r--r-- | README.md | 12 |
2 files changed, 30 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` | ||
| @@ -98,6 +98,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | |||
| 98 | - [NIP-88: Polls](88.md) | 98 | - [NIP-88: Polls](88.md) |
| 99 | - [NIP-89: Recommended Application Handlers](89.md) | 99 | - [NIP-89: Recommended Application Handlers](89.md) |
| 100 | - [NIP-90: Data Vending Machines](90.md) | 100 | - [NIP-90: Data Vending Machines](90.md) |
| 101 | - [NIP-91: AND filters](91.md) | ||
| 101 | - [NIP-92: Media Attachments](92.md) | 102 | - [NIP-92: Media Attachments](92.md) |
| 102 | - [NIP-94: File Metadata](94.md) | 103 | - [NIP-94: File Metadata](94.md) |
| 103 | - [NIP-96: HTTP File Storage Integration](96.md) --- **unrecommended**: replaced by blossom APIs | 104 | - [NIP-96: HTTP File Storage Integration](96.md) --- **unrecommended**: replaced by blossom APIs |
| @@ -316,6 +317,17 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | |||
| 316 | [marmot]: https://github.com/marmot-protocol/marmot | 317 | [marmot]: https://github.com/marmot-protocol/marmot |
| 317 | 318 | ||
| 318 | 319 | ||
| 320 | ## Filters | ||
| 321 | |||
| 322 | | kind | description | NIP | | ||
| 323 | | --------------- | -------------------------- | ------------------------ | | ||
| 324 | | `authors` | by pubkey | [01](01.md) | | ||
| 325 | | `ids` | by ids | [01](01.md) | | ||
| 326 | | `kinds` | by kinds | [01](01.md) | | ||
| 327 | | `#{}` | by indexable tag (OR) | [01](01.md) | | ||
| 328 | | `&{}` | by indexable tag (AND) | [91](91.md) | | ||
| 329 | | `search` | by search times | [50](50.md) | | ||
| 330 | |||
| 319 | ## Message types | 331 | ## Message types |
| 320 | 332 | ||
| 321 | ### Client to Relay | 333 | ### Client to Relay |