Redis Advanced icon

Redis Advanced

Get, send and update data in Redis with enhanced operations

Get Set

AI-generated

Summary

Set a key in Redis to a specified value and return the old value that was replaced, storing that previous value in the workflow data under a specified property name.

Inputs

  • Key (required) — Name of the key to set in Redis.
  • Value (required) — Value to set for the key.
  • Name — Name of the property where the old value of the key will be written (default is 'propertyName').

Output shape

a list with one item containing a JSON object having the property specified by 'Name' with the old value of the key before setting the new one

If the key did not exist before, the old value will be null. The old value is stored using the specified property name and supports dot-notation in property names.

Examples

Example 1: Replace value of a key and get the old value

Set 'Key' to 'myKey', 'Value' to 'newValue', and 'Name' to 'oldValue'. The node replaces the value of 'myKey' with 'newValue' and writes the original value stored under 'oldValue' in the output JSON.

Discussion