使用ZRANGEBYSCORE获得5个最高分-Redis

Use ZRANGEBYSCORE to get the 5 highest scores - Redis

希望从 Redis 中的 ZSET 中检索五个最高分。检查 ZRANGEBYSCORE,看起来我可以使用 +inf 来检索最高分,但不确定是否有一种简单的方法来检索接下来的四个最高分。我不知道任何分数。

我的目的解决方案与 SQL 和 ORDER BY score DESC LIMIT 5

中的类似

Redis 等价物应该是:

ZREVRANGEBYSCORE myzset 0 4