feat(client): add zRevRankWithScore command#3279
Open
raashish1601 wants to merge 1 commit into
Open
Conversation
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
Low risk: additive command wiring and tests only, leaving existing
ZREVRANKbehavior and return type unchanged.Overview
Adds a new
ZREVRANK_WITHSCOREcommand (andzRevRankWithScorealias) that appendsWITHSCOREtoZREVRANKand reusesZRANK_WITHSCOREreply transformation to return{ rank, score }ornull.Registers the command in the client command index with JSDoc, and adds a version-gated spec covering argument transformation plus
nulland populated sorted-set responses.Reviewed by Cursor Bugbot for commit 21934d4. Bugbot is set up for automated code reviews on this repo. Configure here.