Redis Zrank 命令
Redis 教程
· 2019-03-07 22:12:35
Redis Zrank 返回有序集中指定成员的排名。其中有序集成员按分数值递增(从小到大)顺序排列。
语法
redis Zrank 命令基本语法如下:
redis 127.0.0.1:6379> ZRANK key member
可用版本
>= 2.0.0
返回值
如果成员是有序集 key 的成员,返回 member 的排名。 如果成员不是有序集 key 的成员,返回 nil 。
实例
redis 127.0.0.1:6379> ZRANGE salary 0 -1 WITHSCORES # 显示所有成员及其 score 值 1) "peter" 2) "3500" 3) "tom" 4) "4000" 5) "jack" 6) "5000" redis 127.0.0.1:6379> ZRANK salary tom # 显示 tom 的薪水排名,第二 (integer) 1
点击查看所有 Redis 教程 文章: https://www.codercto.com/courses/l/33.html
Clever Algorithms
Jason Brownlee / lulu.com / 2012-6-15 / USD 37.99
Download : http://www.lulu.com/product/file-download/clever-algorithms-nature-inspired-programming-recipes/14696557 Read free on line:http://www.cleveralgorithms.com/nature-inspired/index.html T......一起来看看 《Clever Algorithms》 这本书的介绍吧!