Complete the code to get the first 3 elements from a sorted set named 'myzset'.
ZRANGE myzset 0 [1]
The command ZRANGE myzset 0 2 returns the first 3 elements because the range is inclusive and zero-based.
Complete the code to get the last 2 elements from a sorted set named 'myzset' using ZREVRANGE.
ZREVRANGE myzset [1] -1
The command ZREVRANGE myzset -2 -1 returns the last 2 elements in reverse order.
Fix the error in the command to get elements from index 1 to 3 in 'myzset'.
ZRANGE myzset [1] 3
The correct start index is 1 to get elements from index 1 to 3 inclusive.
Fill both blanks to get elements from index 2 to 4 in reverse order from 'myzset'.
ZREVRANGE myzset [1] [2]
Using ZREVRANGE myzset 2 4 returns elements from index 2 to 4 in reverse order.
Fill all three blanks to get elements from index 1 to 3 with scores included from 'myzset'.
ZRANGE myzset [1] [2] [3]
The command ZRANGE myzset 1 3 WITHSCORES returns elements from index 1 to 3 along with their scores.