upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Wandersleb <leo@leowandersleb.de>2023-05-06 12:29:09 -0400
committerGitHub <noreply@github.com>2023-05-06 12:29:09 -0400
commit535cfcc7e5820798d027be923858fa787a50bc08 (patch)
tree0e89f00116bc7a06f3b62112ae4252b9183ce21a
parentbc9d469c203a25a706727219fa7d37dacaf6040d (diff)
Document multiple queries in a COUNT request
-rw-r--r--45.md8
1 files changed, 6 insertions, 2 deletions
diff --git a/45.md b/45.md
index 87e8000..f0267f6 100644
--- a/45.md
+++ b/45.md
@@ -14,13 +14,13 @@ Some queries a client may want to execute against connected relays are prohibiti
14 14
15## Filters and return values 15## Filters and return values
16 16
17This NIP defines a verb called `COUNT`, which accepts a subscription id and filters as specified in [NIP 01](01.md). 17This NIP defines the verb `COUNT`, which accepts a subscription id and filters as specified in [NIP 01](01.md).
18 18
19``` 19```
20["COUNT", <subscription_id>, <filters JSON>...] 20["COUNT", <subscription_id>, <filters JSON>...]
21``` 21```
22 22
23Counts are returned using a `COUNT` response in the form `{count: <integer>}`. Relays may use probabilistic counts to reduce compute requirements. 23Counts are returned using a `COUNT` response with positional "count" objects in the form `{"count": <integer>}`. Relays may use probabilistic counts to reduce compute requirements.
24 24
25``` 25```
26["COUNT", <subscription_id>, {"count": <integer>}] 26["COUNT", <subscription_id>, {"count": <integer>}]
@@ -36,4 +36,8 @@ Examples:
36# Count posts and reactions 36# Count posts and reactions
37["COUNT", <subscription_id>, {"kinds": [1, 7], "authors": [<pubkey>]}] 37["COUNT", <subscription_id>, {"kinds": [1, 7], "authors": [<pubkey>]}]
38["COUNT", <subscription_id>, {"count": 5}] 38["COUNT", <subscription_id>, {"count": 5}]
39
40# Both of the above in one `COUNT`
41["COUNT", <subscription_id>, {"kinds": [3], "#p": [<pubkey>]}, {"kinds": [1, 7], "authors": [<pubkey>]}]
42["COUNT", <subscription_id>, {"count": 238}, {"count": 5}]
39``` 43```