TOPK.INCRBY
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.
Return value
Section titled “Return value”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 existTopK: increment must be an integer greater or equal to 0 and smaller or equal to 100,000ERR wrong number of arguments for 'topk.incrby' commandfor unpaired arguments.WRONGTYPEif the key holds another type.
Examples
Section titled “Examples”127.0.0.1:6379> TOPK.RESERVE trending 2 50 4 0.9OK127.0.0.1:6379> TOPK.INCRBY trending hotkv 10 redis 41) (nil)2) (nil)127.0.0.1:6379> TOPK.INCRBY trending valkey 61) "redis"127.0.0.1:6379> TOPK.LIST trending WITHCOUNT1) "hotkv"2) (integer) 103) "valkey"4) (integer) 6Compatibility
Section titled “Compatibility”Same as TOPK.INCRBY in RedisBloom. HotKV checks every increment first, so
an invalid one is the whole reply and nothing is counted.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.