Introduction
Top-N queries help you find the highest or lowest N items from a list, like the top 5 scores or best-selling products.
ZRANGE key start stop [WITHSCORES] ZREVRANGE key start stop [WITHSCORES]
ZRANGE leaderboard 0 4 WITHSCORES
ZREVRANGE leaderboard 0 2 WITHSCORES
ZADD leaderboard 100 Alice 200 Bob 150 Carol 180 Dave 120 Eve ZREVRANGE leaderboard 0 2 WITHSCORES
players?scores with members and scores: {"alice": 50, "bob": 70, "carol": 60}, what is the result of ZREVRANGE scores 0 1 WITHSCORES?ZREVRANGE leaderboard 0 4 but get an empty list. What is the most likely cause?game_scores. Which command should you use?Pass the test and this pattern moves unknown