Skip to content

feat(client): add zRevRankWithScore command#3279

Open
raashish1601 wants to merge 1 commit into
redis:masterfrom
raashish1601:codex/2464-zrevrank-withscore
Open

feat(client): add zRevRankWithScore command#3279
raashish1601 wants to merge 1 commit into
redis:masterfrom
raashish1601:codex/2464-zrevrank-withscore

Conversation

@raashish1601
Copy link
Copy Markdown
Contributor

@raashish1601 raashish1601 commented May 17, 2026

Summary

Adds ZREVRANK_WITHSCORE / zRevRankWithScore for Redis 7.2's ZREVRANK key member WITHSCORE form.

This mirrors the existing ZRANK_WITHSCORE implementation and keeps zRevRank itself unchanged, so existing callers keep the current number | null return 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-only direct parse/transform check for ZREVRANK_WITHSCORE
  • npm run lint:changed
  • npm run check:command-jsdoc
  • npm run build
  • git diff --cached --check

I 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 at spawn docker ENOENT because Docker is not installed in this environment.


Note

Low Risk
Low risk: additive command wiring and tests only, leaving existing ZREVRANK behavior and return type unchanged.

Overview
Adds a new ZREVRANK_WITHSCORE command (and zRevRankWithScore alias) that appends WITHSCORE to ZREVRANK and reuses ZRANK_WITHSCORE reply transformation to return { rank, score } or null.

Registers the command in the client command index with JSDoc, and adds a version-gated spec covering argument transformation plus null and populated sorted-set responses.

Reviewed by Cursor Bugbot for commit 21934d4. Bugbot is set up for automated code reviews on this repo. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support ZREVRANK: Added the optional WITHSCORE argument.

1 participant