Skip to content

DOC-7341 Add a node-redis set member expiration example to the sets page - #4651

Merged
andy-stark-redis merged 1 commit into
mainfrom
DOC-7341-node-redis-set-member-expiration
Nov 23, 2026
Merged

andy-stark-redis merged 1 commit into
mainfrom
DOC-7341-node-redis-set-member-expiration

Conversation

@andy-stark-redis

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

Copy link
Copy Markdown
Contributor

Adds a node-redis example to the Member expiration section of the sets page.

  • Example: new member_expiration step in the Node.js sets_tutorial example (local_examples/tmp/datatypes/sets/dt-set.js). It mirrors the first redis-cli block: sAddEx with EX 900 on two members, sAdd of a third, then sTTL on all three. The trailing client.close() moved into the last REMOVE block so the step runs before the connection closes.
  • Page: the first redis-cli block in sets.md is wrapped in a clients-example shortcode with lang_filter="Node.js".

The signatures come from the [email protected] type definitions, because the repo has no data/command-api-mapping files for the set expiration commands yet.

Verification: the whole dt-set.js file ran three times against [email protected] and redis:8.12-rc3, and the asserts passed each time. The step prints 1, 1 and [ 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:

  • Tested on 8.12-rc3 because the 8.12.0 image isn't on Docker Hub yet.
  • This conflicts with the parked Jedis PR DOC-7293 Add a Jedis set member expiration example to the sets page #4526, which wraps the same block with lang_filter="Java-Sync". Whichever merges second must combine the two lang_filter values.
  • The nodejs-dt-set Binder notebook isn't regenerated, and node-redis's own doctests/dt-set.js isn'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 first bikes:reserved example is now a clients-example shortcode (step="member_expiration", lang_filter="Node.js") instead of a raw fenced redis block.

A matching member_expiration step is added to dt-set.js: sAddEx with a 900s TTL, a non-expiring sAdd, then sTTL, with asserts and cleanup. client.close() moves to the file’s final REMOVE block 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.

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]>
@andy-stark-redis andy-stark-redis added the clients Client library docs label Nov 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🧠 Redis Memory

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

Memory updated at e71aca2

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

DOC-7341

@github-actions

Copy link
Copy Markdown
Contributor

@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

Copy link
Copy Markdown
Contributor Author

Thanks for the reviews @dwdougherty !

@andy-stark-redis
andy-stark-redis merged commit 3cb04f1 into main Nov 23, 2026
116 checks passed
@andy-stark-redis
andy-stark-redis deleted the DOC-7341-node-redis-set-member-expiration branch November 23, 2026 16:22
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