Skip to content

DOC-7347 Add a Predis ZMOVE example to the sorted sets page - #4664

Merged
andy-stark-redis merged 1 commit into
mainfrom
DOC-7347-predis-zmove
Nov 25, 2026
Merged

andy-stark-redis merged 1 commit into
mainfrom
DOC-7347-predis-zmove

Conversation

@andy-stark-redis

@andy-stark-redis andy-stark-redis commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Adds a zmove step to the PHP ss_tutorial example and replaces the text-only ZMOVE bookmarks block on the sorted sets page with a clients-example shortcode limited to PHP. The block keeps the ZMOVE ... BYSCORE -inf (1700000000 COUNT 500 command from the old text and adds a DEL, a ZADD and two ZRANGE calls so it runs on its own. The redis-cli output is from a real server.

Run-verified with the example harness on redis:8.12-rc3 (reports 8.11.242) against Predis v3.8.0. The whole DtSortedSetsTest passes. ZMOVE is not in the 8.12-rc2 image, so this needs rc3 or later to run.

Not built with Hugo. ZMOVEMEMBER and BZMOVE are not exercised.

🤖 Generated with Claude Code


Note

Low Risk
Documentation and local example/test harness only; no production runtime or security-sensitive code paths.

Overview
Replaces the sorted sets doc’s plain-text ZMOVE snippet with a PHP-only clients-example (ss_tutorial / zmove) that is self-contained: DEL, ZADD, ZMOVE … BYSCORE with an exclusive cutoff and COUNT, plus ZRANGE … WITHSCORES on source and batch keys—matching the bookmark batching narrative already on the page.

Adds the matching zmove step in DtSortedSetsTest.php (Predis zmove, assertions, cleanup) so the example can be run-verified against Redis 8.12-rc3+ where ZMOVE exists.

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

Adds a `zmove` step to the PHP `ss_tutorial` file and replaces the
text-only ZMOVE bookmarks block on sorted-sets.md with a `clients-example`
shortcode (`lang_filter="PHP"`) holding a runnable redis-cli version: DEL,
ZADD of three pages, the ZMOVE BYSCORE -inf (1700000000 COUNT 500 command
from the old block, and ZRANGE of both sets. The step uses Predis's
`['-inf', '(1700000000']` array form for BYSCORE.

Run-verified on redis:8.12-rc3 (reports 8.11.242) against Predis v3.8.0.
ZMOVE is NOT in the rc2 image (8.11.241): `ERR unknown command 'ZMOVE'`.
SADDEX and BITRANGEINTARRAY are, which is why DOC-7345/7346 ran on rc2.
The whole DtSortedSetsTest passes.

Learned:
- Predis ZMOVE returns a member => score map with scores cast to float,
  but the run printed 1699990000 (no `.0`), while ZRANGE WITHSCORES
  returns string scores ("1700000500"). The `>>>` comments follow the
  actual output, not what the docblock suggests.
- The example hardcodes port 6379 and the dev container there is rc2, so
  I ran rc3 on 6390 and pointed the harness at a temporary copy of the
  file with the port changed. Nothing from that was committed.
- ZMOVEMEMBER and BZMOVE are not exercised; the ticket scoped ZMOVE.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

DOC-7347

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

🧠 Redis Memory

Found 5 related items from repository history (5 new this commit):

Memory updated at 5ae82a0

@andy-stark-redis
andy-stark-redis requested a review from a team November 24, 2026 13:08
@andy-stark-redis andy-stark-redis self-assigned this Nov 24, 2026
@andy-stark-redis andy-stark-redis added the clients Client library docs label Nov 24, 2026

@dwdougherty dwdougherty left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@andy-stark-redis
andy-stark-redis merged commit 1a16842 into main Nov 25, 2026
116 checks passed
@andy-stark-redis
andy-stark-redis deleted the DOC-7347-predis-zmove branch November 25, 2026 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clients Client library docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants