nips/119.md

19 lines
513 B
Markdown
Raw Normal View History

2024-07-15 08:57:34 -04:00
# NIP-119: 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`
- Tags used in `AND` **SHOULD NOT** be used in standard `OR` tags [`#`]
2024-09-23 17:43:48 -04:00
- Any tag used in `AND` **SHOULD** be ignored in `OR`