TOPK.INCRBY

TOPK.INCRBY key item increment [item increment ...]
Available in:
Redis Open Source / Bloom 2.0.0
Time complexity:
O(n * k * incr) where n is the number of items, k is the depth and incr is the increment
ACL categories:
@topk, @write, @slow,
Compatibility:
Redis Software and Redis Cloud compatibility

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

Parameters

  • key: the name of the sketch.
  • item: the items to be incremented.
  • increment: the value by which items will be incremented. The increment must be greater or equal to 1 and less than or equal to 100,000 to avoid server freeze.

Return

Array of Simple string reply - if an element was dropped from the TopK list, Nil reply otherwise..

Example

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

Redis Software and Redis Cloud compatibility

Redis
Software
Redis
Cloud
Notes
✅ Supported
✅ Flexible & Annual
✅ Free & Fixed

Return information

One of the following:

RATE THIS PAGE
Back to top ↑