How to get same rank for same scores in Redis' ZRANK?

后端 未结 4 1543
灰色年华
灰色年华 2020-12-20 22:54

If I have 5 members with scores as follows

a - 1
b - 2
c - 3
d - 3
e - 5

ZRANK of c returns 2, ZRANK of d returns 3

Is there a way

4条回答
  •  天命终不由人
    2020-12-20 23:31

    Then there's this Pull Request - https://github.com/antirez/redis/pull/2011 - which is dead, but appears to make dense rankings on the fly. The original issue/feature request (https://github.com/antirez/redis/issues/943) got some interest so perhaps it is worth reviving it /cc @antirez :)

提交回复
热议问题