ZSet does not support "greater than" only "greater or equal to #93

timherby opened this Issue Feb 1, 2014 · 5 comments

2 participants


Redis supports calling zrevrangebyscore with a max and min value prefixed by a parenthesis. This syntax causes the range to be exclusive rather than inclusive.

See this example from the docs http://redis.io/commands/ZREVRANGEBYSCORE

edis> ZREVRANGEBYSCORE myzset 2 1
1) "two"
2) "one"
redis> ZREVRANGEBYSCORE myzset 2 (1
1) "two"
redis> ZREVRANGEBYSCORE myzset (2 (1
(empty list or set)

When you try this using FakeRedis, you get the following error since the min/max values are parsed as floats:

ArgumentError: invalid value for Float(): "(1391277300"

@timherby thanks for your bug report, can you help us with a PR to fix this?

I will be pretty busy with Rails 4.1.0.rc1 release on the next days and I won't have time to look this soon.


Hi @guilleiguaran, there you go. I added specs for both this and my other pull request. Please let me know if you need anything more.




Hi @guilleiguaran, I have a fix waiting for this. Any chance you could pull it in? Thanks very much!



Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment