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)命令

Scalable Internet Architectures

Scalable Internet Architectures

Theo Schlossnagle / Sams Publishing / 2006-7-31 / USD 49.99

As a developer, you are aware of the increasing concern amongst developers and site architects that websites be able to handle the vast number of visitors that flood the Internet on a daily basis. Sc......一起来看看 《Scalable Internet Architectures》 这本书的介绍吧!

URL 编码/解码

URL 编码/解码

URL 编码/解码

SHA 加密

SHA 加密

SHA 加密工具

XML、JSON 在线转换

XML、JSON 在线转换

在线XML、JSON转换工具