2023-07-26 08:24:44 -04:00
NIP-100
=======
2023-07-26 09:14:58 -04:00
Querying Events by Tags Presence
2023-07-26 08:24:44 -04:00
---------------------------------
`draft` `optional` `author:fernandolguevara` `requires:nip-12`
2023-07-26 09:14:58 -04:00
This NIP allows clients to query events from relays based on the presence or non-presence of specific tags.
2023-07-26 08:24:44 -04:00
2023-07-26 09:14:58 -04:00
### Presense:
2023-07-26 08:24:44 -04:00
The filter condition matches if there is at least one tag name in common with the filter and event.
2023-07-26 09:14:58 -04:00
### Non-Presence:
The filter condition matches if there is at least one tag in the filter that are not present in the event.
2023-07-26 08:24:44 -04:00
Example Subscription Filter
---------------------------
2023-07-26 09:14:58 -04:00
Below are some example filters that demonstrate tag presence and non-presence:
1. Filter to match events with a `g` tag:
2023-07-26 08:24:44 -04:00
```json
{
"tags": ["g"]
}
```
2023-07-26 09:14:58 -04:00
2. Filter to match events without the presence of the `e` tag:
2023-07-26 08:58:44 -04:00
```json
{
"tags": ["!e"]
}
```
2023-07-26 08:24:44 -04:00
Suggested Use Cases
-------------------
One of the suggested use cases for this NIP is for location-specific events. Clients can utilize the provided filter example to locate events with specific location-related tags, regardless of how the location information has been stored in the events.