rev

英[rev] 美[rɛv]

n.<口>The rotation of the engine

vt.& vi .<口> (to cause) to accelerate; (to cause an increase in quantity, activity, etc.); (to make an engine) rotate rapidly; (to make) active

Third person singular: revs Plural: revs Present participle: revving past Formula: revved past participle: revved

range

英[reɪndʒ] 美[rendʒ]

n. Range; range; category; (mountain range , houses, etc.) arrangement

vi. Search; change; extend; roam

vt. Arrange; (according to a certain position or order) sort; classify...; wander

adj. Pasture, grazing area

Third person singular: ranges Plural: ranges Present participle: ranging Past tense: ranged Past participle: ranged

by

英[baɪ] 美[baɪ]

prep.beside...;expression method;due to;passing through

adv.passing;expressing retention or preservation; short visit

score

UK[skɔ:(r)] US[skɔr, skor]

n.Score; score; score; 20 pieces

v. Score; score; score; win

Third person singular: scores Plural: scores Present participle: scoring Past tense: scored Past participle: scored

redis ZREVRANGEBYSCORE command syntax

Function:Returns all members in the ordered set key whose score value is between max and min (the default includes max or min). The members of the sorted set are arranged in order of decreasing score value (from large to small).

Syntax: ZREVRANGEBYSCORE key max min [WITHSCORES] [LIMIT offset count]

Description: Members with the same score value are sorted in lexicographic order Arrange in reverse lexicographical order. The ZREVRANGEBYSCORE command is identical to the ZRANGEBYSCORE command except that members are arranged in decreasing order of score value.

Available versions: >= 2.2.0

Time complexity: O(log(N) M), N is ordered The cardinality of the set, M is the cardinality of the result set.

Returns: A list of ordered set members with score value (optional) in the specified interval.

redis ZREVRANGEBYSCORE command example

redis > ZADD salary 10086 jack
(integer) 1
redis > ZADD salary 5000 tom
(integer) 1
redis > ZADD salary 7500 peter
(integer) 1
redis > ZADD salary 3500 joe
(integer) 1
redis > ZREVRANGEBYSCORE salary +inf -inf   # 逆序排列所有成员
1) "jack"
2) "peter"
3) "tom"
4) "joe"
redis > ZREVRANGEBYSCORE salary 10000 2000  # 逆序排列薪水介于 10000 和 2000 之间的成员
1) "peter"
2) "tom"
3) "joe"