在set的基础上增加了一个值
127.0.0.1:6379> ZADD name 1 zhangsan
(integer) 1
127.0.0.1:6379> ZADD name 1 lisi
(integer) 1
127.0.0.1:6379> ZRANGE name 0 -1
1) "lisi"
2) "zhangsan"
127.0.0.1:6379> ZRANGE name 0 1 withscores
1) "zhangsan"
2) "1"
3) "lisi"
4) "2"
127.0.0.1:6379> ZCARD name
(integer) 2
127.0.0.1:6379> ZCOUNT name 1 2
(integer) 2
127.0.0.1:6379> ZINCRBY name +1 lisi
"2"
127.0.0.1:6379> ZRANGE name 0 -1
1) "zhangsan"
2) "lisi"
127.0.0.1:6379> ZRANK name lisi
(integer) 1
127.0.0.1:6379> ZRANK name zhangsan
(integer) 0
127.0.0.1:6379> ZREM name lisi
(integer) 1
127.0.0.1:6379> ZREM name wangwu
(integer) 0
127.0.0.1:6379> ZRANGE name 0 -1
1) "zhangsan"
|