Set a string value for a given Redis key.
Set a string value for a new key or update the current key value with a new one.
type: "io.kestra.plugin.redis.string.set"Set a string value.
id: redis_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.string.Set
url: redis://:redis@localhost:6379/0
key: "{{ inputs.key_name }}"
value: "{{ inputs.key_value }}"
serdeType: STRING
Set a JSON value.
id: redis_set_json
namespace: company.team
tasks:
- id: set
type: io.kestra.plugin.redis.string.Set
url: "{{ secret('REDIS_URI')}}"
key: "key_json_{{ execution.id }}"
value: |
{{ {
"flow": flow.id,
"namespace": flow.namespace
} | toJson }}
serdeType: JSON
- id: get
type: io.kestra.plugin.redis.string.Get
url: "{{ secret('REDIS_URI')}}"
serdeType: JSON
key: "key_json_{{ execution.id }}"
The redis key you want to set.
STRINGSTRINGJSONFormat of the data contained in Redis.
The connection string.
The value you want to set.
Must be a string for serdeType: STRING or can be an object or a json string serdeType: JSON
falseDefine if you get the older value in response, does not work with Redis 5.X.
{
"mustNotExist": "false",
"mustExist": "false",
"keepTtl": "false"
}Options available when setting a key in Redis.
See redis documentation.
Old value
The old value if you replaced an existing key Required Get to true
date-timeSet the expiration date.
durationSet the expiration duration.
falseRetain the time to live associated with the key.
falseOnly set the key if it already exist.
falseOnly set the key if it does not already exist.