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 its score.

    You can do this as shown below.

    1. (integer) 2
    1. $ ZRANGEBYSCORE z_key -inf +inf
    1. 1) "v1"
    2. 2) "v2"

    Retrieve all member score pairs.

    1. 2) "1.0"
    2. 4) "2.0"

    Bounds are inclusive.

    1. $ ZRANGEBYSCORE z_key 1.0 2.0
    1. 1) "v1"
    2. 2) "v2"
    1. (empty list or set)

    Enforce a limit.

    1. ZRANGEBYSCORE z_key -inf +inf LIMIT 1 1

      zadd, , zrange, , zrevrange