Redis ZINCRBY 命令按增量递增存储在键(key)中的排序集中元素的分数。
返回元素的新分数(双精度浮点数),表示为字符串。
以下是Redis ZINCRBY 命令的基本语法。
链接:https://www.learnfk.comhttps://www.learnfk.com/redis/sorted-sets-zincrby.html
来源:LearnFk无涯教程网
redis 127.0.0.1:6379> ZINCRBY KEY INCREMENT MEMBER
redis 127.0.0.1:6379> ZADD myset 1 "hello" (integer) 1 redis 127.0.0.1:6379> ZADD myset 1 "foo" (integer) 1 redis 127.0.0.1:6379> ZINCRBY myzset 2 "hello" (integer) 3 redis 127.0.0.1:6379> ZRANGE myzset 0 -1 WITHSCORES 1) "foo" 2) "2" 3) "hello" 4) "3"
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)