ZINCRBY key increment member
Time complexity: O(log(N)) where N is the number of elements in the sorted set.
Increments the score of in the sorted set stored at key
by increment
. If does not exist in the sorted set, it is added with increment
as its score (as if its previous score was 0.0
). If does not exist, a new sorted set with the specified member
as its sole member is created.
The value should be the string representation of a numeric value, and accepts double precision floating point numbers. It is possible to provide a negative value to decrement the score.
Bulk string reply: the new score of member
(a double precision floating point number), represented as string.
*Examples
redis> ZADD myzset 2 "two"
redis> ZINCRBY myzset 2 "one"