adding WITHRANK for sorted sets?

20 views
Skip to first unread message

Pawel

unread,
Oct 25, 2012, 5:59:08 PM10/25/12
to redi...@googlegroups.com
Hi.

It may be useful to have "WITHRANK" option for certain sorted set operations.
In my application, I need to: find certain amount of items by SCORE, and then clear them out of the set. At this point, I need to then ask for RANK of first and last element, and only then I can clear them by RANK. It seems to be abusive to have make these two additional look-ups.

Thanks,
  Pawel.

Dvir Volk

unread,
Oct 25, 2012, 6:03:52 PM10/25/12
to redi...@googlegroups.com
I might be missing something, but why can't you just remove them by score?
http://redis.io/commands/zremrangebyscore
> --
> You received this message because you are subscribed to the Google Groups
> "Redis DB" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/redis-db/-/PsP2AMgs4fQJ.
> To post to this group, send email to redi...@googlegroups.com.
> To unsubscribe from this group, send email to
> redis-db+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/redis-db?hl=en.



--
Dvir Volk
Chief Architect, Everything.me
http://everything.me

Pawel Veselov

unread,
Oct 25, 2012, 6:06:57 PM10/25/12
to redi...@googlegroups.com
On Thu, Oct 25, 2012 at 3:03 PM, Dvir Volk <dvi...@gmail.com> wrote:
> I might be missing something, but why can't you just remove them by score?
> http://redis.io/commands/zremrangebyscore

I can't if the retrieved batch had a limit :)
With best of best regards
Pawel S. Veselov
Reply all
Reply to author
Forward
0 new messages