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.INCRBY

Last updated
TOPK.INCRBY key item increment [item increment ...]
Group
Top-K
Complexity
O(n * depth), 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.INCRBY works like TOPK.ADD, but counts increment sightings of each item instead of one. Increments are whole numbers from 0 to 100,000. All of them are checked before anything is counted.

An array with one element per item, the same shape in RESP2 and RESP3: the item that left the list because of this one (bulk string), or nil when none did.

Error replies:

  • TopK: key does not exist
  • TopK: increment must be an integer greater or equal to 0 and smaller or equal to 100,000
  • ERR wrong number of arguments for 'topk.incrby' command for unpaired arguments.
  • 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.INCRBY trending valkey 6
1) "redis"
127.0.0.1:6379> TOPK.LIST trending WITHCOUNT
1) "hotkv"
2) (integer) 10
3) "valkey"
4) (integer) 6

Same as TOPK.INCRBY in RedisBloom. HotKV checks every increment first, so an invalid one is the whole reply and nothing is counted.

TOPK.ADD, TOPK.COUNT, TOPK.LIST