Skip to content

No EX for json.set? #2754

Answered by leibale
NavaceSystem asked this question in Q&A
May 9, 2024 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Unfortunately JSON.SET does not support setting the key expiry.
You can either "pipeline" them one after another:

await Promise.all([
  client.set('json', ...),
  client.expire('json', ...)
]);

use MULTI:

await client.multi()
  .set('json', ...),
  .expire('json', ...)
  .exec();

or, you can use a function/lua script.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@NavaceSystem
Comment options

Answer selected by NavaceSystem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants