Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
(Feature Request) Support Negative Offsets for ZREVRANGEBYSCORE #608
Consider a Redis sorted set with the following members:
If I want to do pagination, starting at an arbitrary slice, I can start with this:
Now, knowing only that my upper bound is 46, I can get the previous 3 items in the set, D, C, and B, without knowing the lower bound by doing:
However, I don't believe I can get the next 3 items in the set, J, I and H, in that order, knowing only that the upper bound is 72.
What I think I want is a negative offset, which I don't think is supported.
I can fake it with a forward range, and then reversing those items, but I'm looking for a native Redis solution, if one exists.
Otherwise, if this can be achieved using a combination of commands, I'd love to hear it!