redis排序
文章内索引
[显示]
hash+sort
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
redis148.akctest1.com:0>hmset good_info_1 price 20 weight 3 "OK" redis148.akctest1.com:0>hmset good_info_2 price 40 weight 5 "OK" redis148.akctest1.com:0>hmset good_info_3 price 30 weight 1 "OK" redis148.akctest1.com:0>sort gid by good_info_*->price redis148.akctest1.com:0>lpush gid 1 "1" redis148.akctest1.com:0>lpush gid 2 "2" redis148.akctest1.com:0>lpush gid 3 "3" redis148.akctest1.com:0>sort gid by good_info_*->price 1) "1" 2) "3" 3) "2" redis148.akctest1.com:0>sort gid by good_info_*->weight 1) "3" 2) "1" 3) "2" redis148.akctest1.com:0> |
sortSet
1 2 3 4 |
ZINCRBY key increment member #增加 ZRANGE key start stop [WITHSCORES] #正序 0-N ZREVRANGE key start stop [WITHSCORES] #倒序 0-N ZREVRANK key member #返回当前成员的排名 |
©版权声明:本文为【翰林小院】(huhanlin.com)原创文章,转载时请注明出处!
发表评论