Redis ZREVRANGE 命令返回有序集 key 中,指定区间内的成员。其中成员的位置按 score 值递减(从大到小)来排列。具有相同 score 值的成员按字典序的逆序排列。
除了成员按 score 值降序排列外, ZREVRANGE 命令的其他方面和 ZRANGE 命令相同。
ZREVRANGE key start stop [WITHSCORES]
127.0.0.1:6379> ZADD salary 3000 jack 3500 helen 2880(integer) 3127.0.0.1:6379> ZRANGE salary 0 -1 withscores1) "john"2) "2880"3) "jack"4) "3000"5) "helen"6) "3500"127.0.0.1:6379> ZREVRANGE salary 0 -1 withscores1) "helen"2) "3500"3) "jack"4) "3000"5) "john"6) "2880"
