feat(client): add zRevRankWithScore command#3279
Merged
nkaradzhov merged 1 commit intoJul 6, 2026
Merged
Conversation
Collaborator
|
Hi @raashish1601, thanks for the PR, i will look into it, hopefully soon! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
ZREVRANK_WITHSCORE/zRevRankWithScorefor Redis 7.2'sZREVRANK key member WITHSCOREform.This mirrors the existing
ZRANK_WITHSCOREimplementation and keepszRevRankitself unchanged, so existing callers keep the currentnumber | nullreturn type while callers that need the score can opt into the new command.Closes #2464.
Redis command reference: https://redis.io/docs/latest/commands/zrevrank/
Validation
node -r ts-node/register/transpile-onlydirect parse/transform check forZREVRANK_WITHSCOREnpm run lint:changednpm run check:command-jsdocnpm run buildgit diff --cached --checkI also attempted a grep-limited Mocha run for
ZREVRANK_WITHSCORE.spec.ts, but this repo starts its Docker-backed Redis test environment in the global hooks before the grep-selected test runs. It failed locally atspawn docker ENOENTbecause Docker is not installed in this environment.Note
Low Risk
Additive read-only command wrapper with no changes to existing APIs; risk is mainly using it against Redis versions before 7.2.
Overview
Adds client support for Redis 7.2
ZREVRANK … WITHSCORE, exposed asZREVRANK_WITHSCORE/zRevRankWithScore, so callers can get a member’s reverse rank and score in one read without changing existingzRevRank(number | null).The new command module follows the same pattern as
ZRANK_WITHSCORE: it reusesZREVRANKargument parsing and appendsWITHSCORE, and maps replies to{ rank, score }ornullviaZRANK_WITHSCORE.transformReply. It is wired into the public commands export inindex.ts, with tests for argument encoding and integration behavior (gated to Redis ≥ 7.2).Reviewed by Cursor Bugbot for commit 21934d4. Bugbot is set up for automated code reviews on this repo. Configure here.