YouTip LogoYouTip

Sorted Sets Zincrby

# Redis Zincrby Command * (javascript:void(0);) * (javascript:void(0);) * (javascript:void(0);) * (javascript:void(0)) Redis Tutorial (#)(#)(#)(#)(#) ## Redis Commands (#)(#)(#)(#)(#)(#)(#)(#)[Redis Pub/Sub](#)(#)(#)(#)(#)(#)(#) ## Redis Advanced Tutorial (#)(#)(#)(#)(#)(#)(#)(#) [](#)(#) (#)[](#) Deep Dive AI Tools, Chatbots, and Virtual Assistants Web Computer Scripting Computer Hardware Programming Scripting Languages Data Management Web Applications & Online Tools Search # Redis Zincrby Command !(#)(#) The Redis Zincrby command increments the score of a specified member in a sorted set by the given increment. By passing a negative increment value, you can decrement the score. For example, `ZINCRBY key -5 member` decreases the score of member by 5. If the key does not exist or the member is not present in the key, `ZINCRBY key increment member` is equivalent to `ZADD key increment member`. If the key does not hold a sorted set, an error is returned. Score values can be integers or double-precision floating-point numbers. ### Syntax The basic syntax for the Redis Zincrby command is as follows: redis 127.0.0.1:6379> ZINCRBY key increment member ### Available since version >= 1.2.0 ### Return value The new score of the member, represented as a string. ### Example redis> ZADD myzset 1 "one"(integer) 1 redis> ZADD myzset 2 "two"(integer) 1 redis> ZINCRBY myzset 2 "one""3" redis> ZRANGE myzset 0 -1 WITHSCORES 1) "two"2) "2"3) "one"4) "3" redis> !(#)(#)")
← Sorted Sets ZrangebylexSorted Sets Zcount β†’