Skip to main content

ZRANGEBYSCORE

Note

Official reference: ZRANGEBYSCORE.

Read a score range in ascending order.

Syntax

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

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

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
ZRANGEBYSCORE demo:ranking 10 20 WITHSCORES LIMIT 0 10