Complete the code to get all members with scores between 50 and 100.
ZRANGEBYSCORE myset [1] 100
The command ZRANGEBYSCORE retrieves members with scores in the given range. Here, the minimum score is 50.
Complete the code to get all members with scores less than or equal to 75.
ZRANGEBYSCORE myset [1] 75
To get all members with scores up to 75, use -inf as the minimum score to include all lower scores.
Fix the error in the code to get members with scores between 20 and 40 inclusive.
ZRANGEBYSCORE myset 20 [1]
The maximum score should be 40 to get members with scores between 20 and 40 inclusive.
Fill both blanks to get members with scores strictly greater than 30 and less than or equal to 60.
ZRANGEBYSCORE myset [1] [2]
Using (30 means scores strictly greater than 30. Using 60 means scores up to and including 60.
Fill all three blanks to get members with scores strictly between 10 and 90, and limit the result to 5 members.
ZRANGEBYSCORE myset [1] [2] LIMIT 0 [3]
(10 excludes 10, (90 excludes 90, so scores strictly between 10 and 90. LIMIT 0 5 returns first 5 members.