注意:score 值可以是整数值或双精度浮点数。
ZINCRBY key increment member
127.0.0.1:6379> ZADD web:uv 1350 www.lmcjl.com 1200 task.lmcjl.com 2000 www.jd.com #添加成员 (integer) 3 127.0.0.1:6379> ZRANGE web:uv 0 2 withscores #查看所有成员 1) "task.lmcjl.com" 2) "1200" 3) "www.lmcjl.com" 4) "1350" 5) "www.jd.com" 6) "2000" 127.0.0.1:6379> ZINCRBY web:uv 100 www.lmcjl.com #给定的成员增加相应的分值 "1450" 127.0.0.1:6379> ZINCRBY web:uv 100 www.lmcjl.com "1550" 127.0.0.1:6379> ZINCRBY web:uv -100 www.lmcjl.com #减去相应的分值 "1450"
本文链接:http://task.lmcjl.com/news/17508.html