ZREVRANGEBYSCORE (已弃用)
截至Redis版本6.2.0,此命令被视为已弃用。
在迁移或编写新代码时,可以使用带有REV和BYSCORE参数的ZRANGE来替换它。
Syntax
ZREVRANGEBYSCORE key max min [WITHSCORES] [LIMIT offset count]
- Available since:
- 2.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 being returned. If M is constant (e.g. always asking for the first 10 elements with LIMIT), you can consider it O(log(N)).
- ACL categories:
-
@read,@sortedset,@slow,
返回在key中所有分数介于max和min之间的元素(包括分数等于max或min的元素)。与排序集合的默认排序相反,对于此命令,元素被认为是从高分到低分排序的。
具有相同分数的元素按反向字典顺序返回。
除了顺序相反,ZREVRANGEBYSCORE 与
ZRANGEBYSCORE 类似。
示例
RESP2/RESP3 回复
- Array reply: 指定分数范围内的成员列表,以及可选的他们的分数。
历史
- 从 Redis 版本 2.1.6 开始:
min和max可以是独占的。