Set a JSON type value for a given Redis key.
Set a JSON type value for a new key or update the current key value with a new one.
yaml
type: "io.kestra.plugin.redis.json.Set"
Examples
Set a JSON value.
yaml
id: redis_json_set
namespace: company.team
inputs:
- id: key_name
type: STRING
displayName: Key Name
- id: key_value
type: STRING
displayName: Key Value
tasks:
- id: set
type: io.kestra.plugin.redis.json.Set
url: redis://:redis@localhost:6379/0
key: "{{ inputs.key_name }}"
value: |
{
"name": "{{ inputs.key_value }}"
}
Properties
key *Requiredstring
The redis key you want to set.
url *Requiredstring
The connection string.
value *Requiredobject
The value you want to set as type JSON.
get booleanstring
Default
false
Define if you get the older value in response, does not work with Redis 5.X.
options Non-dynamicSet-Options
Default
{
"mustNotExist": "false",
"mustExist": "false"
}
Options available when setting a key in Redis.
See redis documentation.
path string
Default
$
JSON path to extract value (default is root '$')
Outputs
oldValue object
Old value
The old value if you replaced an existing key Required Get to true
Definitions
io.kestra.plugin.redis.json.Set-Options
mustExist booleanstring
Default
false
Only set the key if it already exist.
mustNotExist booleanstring
Default
false
Only set the key if it does not already exist.