ZINCRBY
Syntax
ZINCRBY key increment member
- Available since:
- 1.2.0
- Time complexity:
- O(log(N)) where N is the number of elements in the sorted set.
- ACL categories:
-
@write
,@sortedset
,@fast
,
将存储在key
中的有序集合中的member
的分数增加increment
。
如果member
在有序集合中不存在,则将其添加,并将increment
作为其分数(就像其之前的分数是0.0
)。
如果key
不存在,则创建一个新的有序集合,并将指定的member
作为其唯一成员。
当key
存在但不持有排序集合时,将返回错误。
score
值应为数值的字符串表示形式,并且接受双精度浮点数。可以提供负值来减少分数。