Better ZRANGE functionality / Scoreboard

24 views
Skip to first unread message

Michel Comeau

unread,
Aug 10, 2016, 10:57:07 AM8/10/16
to Redis DB
This could be a repeat of a post i did that didnt show up, i'm new to google groups.

I have a need to have a scoreboard type functionality, where people have points added as they do specific things, but its possible for the points to show a tie.

I know that redis uses a lexicographic sorting order when there is a tie, but that would not work for me.

What i need is to be able to discriminate based on a different value, like the date that the entry was updated, so the first one to reach a score gets the goodies.

I also realize that there could be more cases where ZRANGE could benefit by having a complementary custom field for discrimination. 

Seems like a nice to have to me.

If someone could suggest a way i could make it work with Redis only, maybe by using 2 entries, or a composite key, i would appreciate.

Michel.
Reply all
Reply to author
Forward
0 new messages