Actions37
- Append
- Blocking Pop Left
- Blocking Pop Right
- Delete
- Eval
- Exists
- Expire At
- Get
- Get Set
- Hash Exists
- Hash Keys
- Hash Length
- Hash Values
- Increment
- Info
- JSON Get
- JSON Set
- Keys
- List Length
- Multi Get
- Multi Set
- Persist
- Pop
- Publish
- Push
- Scan
- Set
- Set Add
- Set Cardinality
- Set Is Member
- Set Remove
- Sorted Set Add
- Sorted Set Cardinality
- Sorted Set Range
- Sorted Set Remove
- String Length
- TTL
Get Set
AI-generatedSummary
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.