Redis Zrevrange 命令

更新时间: 2019-07-07 15:54

Redis Zrevrange 命令返回有序集中,指定区间内的成员。

其中成员的位置按分数值递减(从大到小)来排列。

具有相同分数值的成员按字典序的逆序(reverse lexicographical order)排列。

除了成员按分数值递减的次序排列这一点外, ZREVRANGE 命令的其他方面和 Redis Zrange 命令 一样。

语法

redis Zrevrange 命令基本语法如下:

redis 127.0.0.1:6379> ZREVRANGE key start stop [WITHSCORES]

可用版本

>= 1.2.0

返回值

指定区间内,带有分数值(可选)的有序集成员的列表。

实例

redis 127.0.0.1:6379> ZRANGE salary 0 -1 WITHSCORES        # 递增排列
1) "peter"
2) "3500"
3) "tom"
4) "4000"
5) "jack"
6) "5000"

redis 127.0.0.1:6379> ZREVRANGE salary 0 -1 WITHSCORES     # 递减排列
1) "jack"
2) "5000"
3) "tom"
4) "4000"
5) "peter"
6) "3500"

查看更多 Redis 有序集合(sorted set)命令

The Nature of Code

The Nature of Code

Daniel Shiffman / The Nature of Code / 2012-12-13 / GBP 19.95

How can we capture the unpredictable evolutionary and emergent properties of nature in software? How can understanding the mathematical principles behind our physical world help us to create digital w......一起来看看 《The Nature of Code》 这本书的介绍吧!

HEX CMYK 转换工具

HEX CMYK 转换工具

HEX CMYK 互转工具

HSV CMYK 转换工具

HSV CMYK 转换工具

HSV CMYK互换工具