diff options
Diffstat (limited to 'redis/client.py')
-rwxr-xr-x | redis/client.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/redis/client.py b/redis/client.py index 902ccc9..6e4c9ab 100755 --- a/redis/client.py +++ b/redis/client.py @@ -1661,6 +1661,22 @@ class StrictRedis(object): pieces.extend([Token('LIMIT'), start, num]) return self.execute_command(*pieces) + def zrevrangebylex(self, name, upper, lower, start=None, num=None): + """ + Return the reversed lexicographical range of values from sorted set + ``name`` between ``upper`` and ``lower``. + + If ``start`` and ``num`` are specified, then return a slice of the + range. + """ + if (start is not None and num is None) or \ + (num is not None and start is None): + raise RedisError("``start`` and ``num`` must both be specified") + pieces = ['ZREVRANGEBYLEX', name, upper, lower] + if start is not None and num is not None: + pieces.extend([Token('LIMIT'), start, num]) + return self.execute_command(*pieces) + def zrangebyscore(self, name, min, max, start=None, num=None, withscores=False, score_cast_func=float): """ |