Skip to content
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions 119.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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 [`#`]
- Any tag used in `AND` **SHOULD** be ignored in `OR`