View on GitHub
Return a range of members in a sorted set, by score.
@example Retrieve members with score `>= 5` and `< 100`
redis.zrangebyscore("zset", "5", "(100")
# => ["a", "b"]
@example Retrieve the first 2 members with score `>= 0`
redis.zrangebyscore("zset", "0", "+inf", :limit => [0, 2])
# => ["a", "b"]
@example Retrieve members and their scores with scores `> 5`
redis.zrangebyscore("zset", "(5", "+inf", :with_scores => true)
# => [["a", 32.0], ["b", 64.0]]
@param [String] key
@param [String] min
- inclusive minimum score is specified verbatim
- exclusive minimum score is specified by prefixing `(`
@param [String] max
- inclusive maximum score is specified verbatim
- exclusive maximum score is specified by prefixing `(`
@param [Hash] options
- `:with_scores => true`: include scores in output
- `:limit => [offset, count]`: skip `offset` members, return a maximum of
`count` members
@return [Array<String>, Array<[String, Float]>]
- when `:with_scores` is not specified, an array of members
- when `:with_scores` is specified, an array with `[member, score]` pairs