@@ -1588,6 +1588,38 @@ def zremrangebyrank(key, start, stop)
1588
1588
end
1589
1589
end
1590
1590
1591
+ # Return a range of members with the same score in a sorted set, by lexicographical ordering
1592
+ #
1593
+ # @example Retrieve members matching a
1594
+ # redis.zrangebylex("zset", "[a", "[a\xff")
1595
+ # # => ["aaren", "aarika", "abagael", "abby"]
1596
+ # @example Retrieve the first 2 members matching a
1597
+ # redis.zrangebylex("zset", "[a", "[a\xff", :limit => [0, 2])
1598
+ # # => ["aaren", "aarika"]
1599
+ #
1600
+ # @param [String] key
1601
+ # @param [String] min
1602
+ # - inclusive minimum is specified by prefixing `(`
1603
+ # - exclusive minimum is specified by prefixing `[`
1604
+ # @param [String] max
1605
+ # - inclusive maximum is specified by prefixing `(`
1606
+ # - exclusive maximum is specified by prefixing `[`
1607
+ # @param [Hash] options
1608
+ # - `:limit => [offset, count]`: skip `offset` members, return a maximum of
1609
+ # `count` members
1610
+ #
1611
+ # @return [Array<String>, Array<[String, Float]>]
1612
+ def zrangebylex ( key , min , max , options = { } )
1613
+ args = [ ]
1614
+
1615
+ limit = options [ :limit ]
1616
+ args . concat ( [ "LIMIT" ] + limit ) if limit
1617
+
1618
+ synchronize do |client |
1619
+ client . call ( [ :zrangebylex , key , min , max ] + args )
1620
+ end
1621
+ end
1622
+
1591
1623
# Return a range of members in a sorted set, by score.
1592
1624
#
1593
1625
# @example Retrieve members with score `>= 5` and `< 100`
0 commit comments