ZREVRANGE

Since 1.1.0Sorted sets

Syntax

ZREVRANGE key start stop [WITHSCORES]
  • Flags: readonly
  • ACL categories: @read, @slow, @sortedset
  • Arity: -4

Returns members of the sorted set at key by rank, highest score first. It is ZRANGE with REV, kept for old clients.

Examples

> ZADD r 4 d 5 e
(integer) 2
> ZREVRANGE r 0 1 WITHSCORES
1) "e"
2) "5"
3) "d"
4) "4"