Skip to content

Commit 3d3898d

Browse files
committed
Merge pull request redis#399 from badboy/doc-zrevrangebylex
Documented ZREVRANGEBYLEX
2 parents 1ff7680 + 231a808 commit 3d3898d

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

commands.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2213,6 +2213,32 @@
22132213
"since": "2.8.9",
22142214
"group": "sorted_set"
22152215
},
2216+
"ZREVRANGEBYLEX": {
2217+
"summary": "Return a range of members in a sorted set, by lexicographical range, ordered from higher to lower strings.",
2218+
"complexity": "O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements being returned. If M is constant (e.g. always asking for the first 10 elements with LIMIT), you can consider it O(log(N)).",
2219+
"arguments": [
2220+
{
2221+
"name": "key",
2222+
"type": "key"
2223+
},
2224+
{
2225+
"name": "max",
2226+
"type": "string"
2227+
},
2228+
{
2229+
"name": "min",
2230+
"type": "string"
2231+
},
2232+
{
2233+
"command": "LIMIT",
2234+
"name": ["offset", "count"],
2235+
"type": ["integer", "integer"],
2236+
"optional": true
2237+
}
2238+
],
2239+
"since": "2.9.9",
2240+
"group": "sorted_set"
2241+
},
22162242
"ZRANGEBYSCORE": {
22172243
"summary": "Return a range of members in a sorted set, by score",
22182244
"complexity": "O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements being returned. If M is constant (e.g. always asking for the first 10 elements with LIMIT), you can consider it O(log(N)).",

commands/zrevrangebylex.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
When all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering, this command returns all the elements in the sorted set at `key` with a value between `max` and `min`.
2+
3+
Apart from the reversed ordering, `ZREVRANGEBYLEX` is similar to `ZRANGEBYLEX`.
4+
5+
@return
6+
7+
@array-reply: list of elements in the specified score range.
8+
9+
@examples
10+
11+
```cli
12+
ZADD myzset 0 a 0 b 0 c 0 d 0 e 0 f 0 g
13+
ZREVRANGEBYLEX myzset [c -
14+
ZREVRANGEBYLEX myzset (c -
15+
ZREVRANGEBYLEX myzset (g [aaa
16+
```

0 commit comments

Comments
 (0)