Redis Zrevrank command

Redis Zrevrank command returns a ranking member of the ordered set. Which ordered set point value decreasing by members (descending) order.

0 ranking as the bottom, that is, the maximum value of the score is zero ranking members.

Use ZRANK command can be obtained by members of the fractional value is incremented (small to large) arranged in the rankings.

grammar

redis Zrevrank basic command syntax is as follows:

redis 127.0.0.1:6379> ZREVRANK key member

Available versions

>= 2.2.0

return value

If the member is a member of an ordered set of key returns ranking members. If the member is not a member of an ordered set of key, returns nil.

Examples

Redis 127.0 . 0.1 : 6379 > Z Range The the salary 0 - . 1 WITHSCORES # Test Data . 1 ) "Jack" 2 ) "2000" . 3 ) "Peter" . 4 ) "3500" . 5 ) "Tom" . 6 ) "5000" Redis 127.0 . 0.1 : 6379 > ZREVRANK the salary Peter # Peter pay a second row ( Integer ) . 1 Redis 127.0 . 0.1 :6379>               ZREVRANK salary tom highest # tom wages ( Integer ) 0  

Guess you like

Origin www.cnblogs.com/zhuyeshen/p/12080708.html