Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

TOPK.QUERY

Last updated
TOPK.QUERY key item [item ...]
Group
Top-K
Complexity
O(n), n being the items
Arity
-1 (at least 1 words, counting the command name)
Flags
none
Keys
first 1, last 1, step 1
HotKV Cloud
All plans
On-Premise
no license needed

TOPK.QUERY tells you, for each item, whether it is currently one of the top items kept by the Top-K at key.

An array with one element per item:

Element RESP2 RESP3
In the list Integer 1 Boolean true
Not in the list Integer 0 Boolean false

Error replies: TopK: key does not exist, and WRONGTYPE if the key holds another type.

127.0.0.1:6379> TOPK.RESERVE trending 2 50 4 0.9
OK
127.0.0.1:6379> TOPK.INCRBY trending hotkv 10 redis 4
1) (nil)
2) (nil)
127.0.0.1:6379> TOPK.QUERY trending hotkv memcached
1) (integer) 1
2) (integer) 0

Same as TOPK.QUERY in RedisBloom.

TOPK.LIST, TOPK.COUNT, TOPK.ADD