Skip to main content

ZREVRANGE

Note

Official reference: ZREVRANGE.

Read a range by descending rank.

Syntax​

ZREVRANGE key start stop [WITHSCORES]

Ranks are zero-based and the end position is inclusive; negative indices count from the end.

ZRANGE ... REV is also available.

Results​

ReturnRowsContent
ResultSetmultipleELEMENT field, STRING type
SCORE field, DOUBLE type (when using WITHSCORES)

Example​

ZADD demo:ranking 10 alice 20 bob
ZREVRANGE demo:ranking 0 9 WITHSCORES