ZRANGEBYSCORE
Returns a list of members
found in the range specified by min
, max
, unless the WITHSCORES option is specified (see below).
- WITHSCORES: Makes the command return both the
member
and itsscore
.
You can do this as shown below.
(integer) 2
$ ZRANGEBYSCORE z_key -inf +inf
1) "v1"
2) "v2"
Retrieve all member score pairs.
2) "1.0"
4) "2.0"
Bounds are inclusive.
$ ZRANGEBYSCORE z_key 1.0 2.0
1) "v1"
2) "v2"
(empty list or set)
Enforce a limit.
ZRANGEBYSCORE z_key -inf +inf LIMIT 1 1