ZRANGEBYSCORE

Since 1.1.0Sorted sets

Syntax

ZRANGEBYSCORE key min max [WITHSCORES] [LIMIT offset count]
  • Flags: readonly
  • ACL categories: @read, @slow, @sortedset
  • Arity: -4

Returns members of the sorted set at key with scores from min to max, lowest first. It is ZRANGE with BYSCORE, kept for old clients.

Examples

> ZADD r 1 a 2 b 3 c
(integer) 3
> ZRANGEBYSCORE r 2 3 WITHSCORES
1) "b"
2) "2"
3) "c"
4) "3"