Repository navigation
DOC-7341 Add a node-redis set member expiration example to the sets page - #4651
Merged
Merged
Conversation
Adds a member_expiration step to the Node.js sets_tutorial example and wraps the first
redis-cli block in the Member expiration section of sets.md in a clients-example shortcode
for Node.js. The step mirrors that block and the parked Jedis step: SADDEX with EX 900 on
two members, SADD of a third, then STTL on all three.
node-redis exposes these as sAddEx with an options object, { expiration: { type: 'EX',
value: 900 } }, and sTTL with an array of members. There are no command-api-mapping files
for the set expiration commands yet, so the signatures come from the type definitions in
[email protected], where the commands first ship.
The step deletes its own key first, as the sRem step does, so it doesn't depend on step
order. The old trailing client.close() moved into the last REMOVE block so the new step
runs before the connection closes.
Verified by running the whole dt-set.js file three times against [email protected] and a
redis:8.12-rc3 container: the asserts pass and the step prints 1, 1 and [ 900, 900, -1 ].
A changed expected value makes the file fail, so the asserts do run. The build parser
reads the step as lines 116-125 with no scaffolding in the visible range.
Learned: STTL right after SADDEX returns exactly 900, so the TTL assert is stable across runs
Directive: when the Jedis PR 4526 merges, both PRs wrap the same block, so merge the lang_filter values instead of choosing one
Gaps: tested on 8.12-rc3 because the 8.12.0 image is not on Docker Hub yet; the nodejs-dt-set Binder notebook is not regenerated
Recheck: when a command-api-mapping entry for SADDEX and STTL lands, confirm it matches sAddEx and sTTL here
Ticket: DOC-7341
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Contributor
🧠 Redis MemoryFound 5 related items from repository history (5 new this commit):
Memory updated at e71aca2 |
Contributor
Contributor
Author
|
Thanks for the reviews @dwdougherty ! |
andy-stark-redis
deleted the
DOC-7341-node-redis-set-member-expiration
branch
November 23, 2026 16:22
This was referenced Nov 24, 2026
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 node-redis example to the Member expiration section of the sets page.
member_expirationstep in the Node.jssets_tutorialexample (local_examples/tmp/datatypes/sets/dt-set.js). It mirrors the first redis-cli block:sAddExwithEX 900on two members,sAddof a third, thensTTLon all three. The trailingclient.close()moved into the lastREMOVEblock so the step runs before the connection closes.clients-exampleshortcode withlang_filter="Node.js".The signatures come from the
[email protected]type definitions, because the repo has nodata/command-api-mappingfiles for the set expiration commands yet.Verification: the whole
dt-set.jsfile ran three times against[email protected]andredis:8.12-rc3, and the asserts passed each time. The step prints1,1and[ 900, 900, -1 ]. A changed expected value makes the file fail. The build's example parser reads the step as lines 116-125 with no scaffolding in the visible range.Notes:
8.12-rc3because the8.12.0image isn't on Docker Hub yet.lang_filter="Java-Sync". Whichever merges second must combine the twolang_filtervalues.nodejs-dt-setBinder notebook isn't regenerated, and node-redis's owndoctests/dt-set.jsisn't changed.Ticket: DOC-7341
🤖 Generated with Claude Code
Note
Low Risk
Docs and local example scaffolding only; no production code or security-sensitive changes.
Overview
Documents set member expiration on the sets page with a Node.js (
node-redis) tab alongside the existing CLI snippet. The firstbikes:reservedexample is now aclients-exampleshortcode (step="member_expiration",lang_filter="Node.js") instead of a raw fencedredisblock.A matching
member_expirationstep is added todt-set.js:sAddExwith a 900s TTL, a non-expiringsAdd, thensTTL, with asserts and cleanup.client.close()moves to the file’s finalREMOVEblock so earlier tutorial steps still run with an open connection.Reviewed by Cursor Bugbot for commit e71aca2. Bugbot is set up for automated code reviews on this repo. Configure here.