TOPK.INCRBY key item increment [ item increment ...]

Available in: Redis Stack

Time complexity: O(n * k * incr) where n is the number of items, k is the depth and incr is the increment

Increase the score of an item in the data structure by increment. Multiple items' score can be increased at once. If an item enters the Top-K list, the item which is expelled is returned.

Parameters

  • key: Name of sketch where item is added.
  • item: Item/s to be added.
  • increment: increment to current item score.

Return

[] otherwise..

@example

redis> TOPK.INCRBY topk foo 3 bar 2 42 30
1) (nil)
2) (nil)
3) foo