Repository navigation
DOC-7347 Add a Predis ZMOVE example to the sorted sets page - #4664
Merged
Merged
Conversation
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]>
Contributor
Contributor
🧠 Redis MemoryFound 5 related items from repository history (5 new this commit):
Memory updated at 5ae82a0 |
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.
Adds a
zmovestep to the PHPss_tutorialexample and replaces the text-onlyZMOVEbookmarks block on the sorted sets page with aclients-exampleshortcode limited to PHP. The block keeps theZMOVE ... BYSCORE -inf (1700000000 COUNT 500command from the old text and adds aDEL, aZADDand twoZRANGEcalls 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(reports8.11.242) against Predis v3.8.0. The wholeDtSortedSetsTestpasses.ZMOVEis not in the8.12-rc2image, so this needs rc3 or later to run.Not built with Hugo.
ZMOVEMEMBERandBZMOVEare 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
ZMOVEsnippet with a PHP-onlyclients-example(ss_tutorial/zmove) that is self-contained:DEL,ZADD,ZMOVE … BYSCOREwith an exclusive cutoff andCOUNT, plusZRANGE … WITHSCORESon source and batch keys—matching the bookmark batching narrative already on the page.Adds the matching
zmovestep inDtSortedSetsTest.php(Prediszmove, assertions, cleanup) so the example can be run-verified against Redis 8.12-rc3+ whereZMOVEexists.Reviewed by Cursor Bugbot for commit 5ae82a0. Bugbot is set up for automated code reviews on this repo. Configure here.