TOPK.INCRBY
Syntax
TOPK.INCRBY key item increment [item increment ...]
- Available in:
- Redis Stack / 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
通过增量增加数据结构中某个项目的分数。 可以同时增加多个项目的分数。 如果一个项目进入Top-K列表,则返回被排出的项目。
参数
- key: 添加项目的草图名称。
- item: 要添加的项目。
- increment: 当前项目分数的增量。增量必须大于或等于1。为了避免服务器冻结,增量限制为100,000。
返回
Array reply 的 Simple string reply - 如果从 TopK 列表中删除了一个元素,则为 Nil reply。
@example
redis> TOPK.INCRBY topk foo 3 bar 2 42 30
1) (nil)
2) (nil)
3) foo