ZREVRANGE (已弃用)
自 Redis 6.2.0 版本起,此命令被视为已弃用。
在迁移或编写新代码时,可以使用带有REV
参数的ZRANGE
来替换它。
Syntax
ZREVRANGE key start stop [WITHSCORES]
- Available since:
- 1.2.0
- Time complexity:
- O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements returned.
- ACL categories:
-
@read
,@sortedset
,@slow
,
返回存储在key
中的有序集合中指定范围的元素。
元素被认为是按分数从高到低排序的。
对于分数相同的元素,使用降序字典顺序。
除了顺序相反,ZREVRANGE
与ZRANGE
类似。
示例
RESP2/RESP3 回复
- Array reply: 指定范围内的成员列表,如果使用了WITHSCORE,则可以选择性地包含它们的分数。