Skip to main content

ZREVRANGEBYSCORE

Note

Official reference: ZREVRANGEBYSCORE.

Read a score range in descending order.

Syntax

ZREVRANGEBYSCORE key max min [WITHSCORES] [LIMIT offset count]

Numeric bounds are inclusive; (10 excludes 10. -inf/+inf mean no lower/upper bound.

Bounds are ordered max min. LIMIT offset count skips offset matching members and returns at most count.

Results

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

Example

ZADD demo:ranking 10 alice 20 bob
ZREVRANGEBYSCORE demo:ranking 20 10 WITHSCORES LIMIT 0 10