diff options
author | C Charles <chentianjie.ctj@alibaba-inc.com> | 2022-11-28 17:57:11 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-28 11:57:11 +0200 |
commit | eeca7f29117a5e376da3e6f1a419fdf5a6e78e8b (patch) | |
tree | 0aaebf1dc9b63aa5c8ead129c99565ed0b37728e /src/commands | |
parent | 376b689b03e22889b62e60013d7622cbf98d3dc7 (diff) | |
download | redis-eeca7f29117a5e376da3e6f1a419fdf5a6e78e8b.tar.gz |
Add withscore option to ZRANK and ZREVRANK. (#11235)
Add an option "withscores" to ZRANK and ZREVRANK.
Add `[withscore]` option to both `zrank` and `zrevrank`, like this:
```
z[rev]rank key member [withscore]
```
Diffstat (limited to 'src/commands')
-rw-r--r-- | src/commands/zrank.json | 16 | ||||
-rw-r--r-- | src/commands/zrevrank.json | 14 |
2 files changed, 27 insertions, 3 deletions
diff --git a/src/commands/zrank.json b/src/commands/zrank.json index 6d5154715..a15d96c59 100644 --- a/src/commands/zrank.json +++ b/src/commands/zrank.json @@ -4,8 +4,14 @@ "complexity": "O(log(N))", "group": "sorted_set", "since": "2.0.0", - "arity": 3, + "arity": -3, "function": "zrankCommand", + "history": [ + [ + "7.2.0", + "Added the optional `WITHSCORE` argument." + ] + ], "command_flags": [ "READONLY", "FAST" @@ -42,7 +48,13 @@ { "name": "member", "type": "string" + }, + { + "name": "withscore", + "token": "WITHSCORE", + "type": "pure-token", + "optional": true } ] } -} +}
\ No newline at end of file diff --git a/src/commands/zrevrank.json b/src/commands/zrevrank.json index bcd487695..7d5aa795b 100644 --- a/src/commands/zrevrank.json +++ b/src/commands/zrevrank.json @@ -4,8 +4,14 @@ "complexity": "O(log(N))", "group": "sorted_set", "since": "2.0.0", - "arity": 3, + "arity": -3, "function": "zrevrankCommand", + "history": [ + [ + "7.2.0", + "Added the optional `WITHSCORE` argument." + ] + ], "command_flags": [ "READONLY", "FAST" @@ -42,6 +48,12 @@ { "name": "member", "type": "string" + }, + { + "name": "withscore", + "token": "WITHSCORE", + "type": "pure-token", + "optional": true } ] } |