You can also use the ZRANGE command to show all of the elements of a sorted ZSET using the WITHSCORES option as shown here:
127.0.0.1:6379> ZRANGE "id" 0 -1 WITHSCORES
1) "Mark"
2) "1"
3) "Arthur"
4) "2"
5) "Monica"
6) "3"
7) "Daniel"
8) "4"
9) "Sergio"
10) "5"
Using the Redis Zrangebyscore Command : Fine-tune your results by inputting your desired members range by using the Redis ZSET command ZRANGEBYSCORE.
The ZRANGEBYSCORE command displays every element in a set based on a score range when you specify a minimum and maximum number as shown in this example here:
127.0.0.1:6379> ZRANGEBYSCORE "id" 0 2
1) "Mark"
2) "Arthur"
Try out the ZRANGEBYSCORE command with the WITHSCORES option like this :
127.0.0.1:6379> ZRANGEBYSCORE "id" 0 2 withscores
1) "Mark"
2) "1"
3) "Arthur"
4) "2"