Skip to main content
Version: ACE 5

Redis Step

Overview

Redis step is used to access Redis database and make queries on the database

Configuration

  • Connection string - the Redis connection string example: redis[s]://[[username][:password]@][host][:port][/db-number]
  • Use TLS - flag, to be set to true if redis is tls enabled.
  • TLS Key - TLS private key string. Suggested apporach is to use environment variable.
  • TLS Cert - TLS cert string. Suggested apporach is to use environment variable.
  • TLS CA - TLS CA string. Suggested apporach is to use environment variable
  • Configuration - list of queries to be made
    • action - the action to preform - currently supported are get, set, delete and custom methods
    • target path - the doc node on which to attach the result of query
    • payload - used in custom method to specify witch Redis method should be executed example: ["SET", "key", "value"]
    • options - used to provide additional options for method
    • key - key to be saved in database also used to find existing key value pair in database
    • value - value to be saved in database
    • doJsonStringify - specify if value that will be saved in database should be stringified (this should be true for all values that are not strings)
    • doJsonParse - specify if returned value should be parsed (this is mandatory for all values that where stringified before saving)
info

Below is a suggested approach to define the tls Key, Cert and CA.

{{$env.REDIS_CACHE_TLS_KEY}}

info

Find ways to use additional options here Redis-node documentation

For full list of Redis commands refer to Redis commands

Examples

GET

Redis step get configuration
stepType: redis
config:
actions:
- action: get
options: {}
key: test
target: result
doJsonParse: false
connectionString: redis://127.0.0.1:6379
name: Redis
description: ""
condition: ""
Flow Result
{
"doc": {
"result": "test"
},
"errors": [],
"performance": {
"steps": [
{
"step": "redis",
"executionTime": 25
}
],
"executionTimeOfFlow": 26,
"timeMetric": "ms"
}
}
Redis GET Flow Example
    tags:
- general
steps:
- stepType: redis
config:
actions:
- action: get
options: {}
key: test
target: result
doJsonParse: false
connectionString: redis://127.0.0.1:6379
name: Redis
description: ""
condition: ""
sampleData: {}

SET

Redis step set configuration
stepType: redis
config:
actions:
- action: set
options: {}
key: test
value: test
target: result
doJsonStringify: false
connectionString: redis://127.0.0.1:6379
name: Redis
description: ""
condition: ""
Flow Result
{
"doc": {
"result": "OK"
},
"errors": [],
"performance": {
"steps": [
{
"step": "redis",
"executionTime": 25
}
],
"executionTimeOfFlow": 26,
"timeMetric": "ms"
}
}
Redis SET Flow Example
    tags:
- general
steps:
- stepType: redis
config:
actions:
- action: set
options: {}
key: test
value: test
target: result
doJsonStringify: false
connectionString: redis://127.0.0.1:6379
name: Redis
description: ""
condition: ""
sampleData: {}

DELETE

Redis step delete configuration
stepType: redis
config:
actions:
- action: delete
options: {}
key: test
target: result
connectionString: redis://127.0.0.1:6379
name: Redis
description: ""
condition: ""
Flow Result
{
"doc": {
"result": 1
},
"errors": [],
"performance": {
"steps": [
{
"step": "redis",
"executionTime": 25
}
],
"executionTimeOfFlow": 26,
"timeMetric": "ms"
}
}
Redis DELETE Flow Example
    tags:
- general
steps:
- stepType: redis
config:
actions:
- action: delete
options: {}
key: test
target: result
connectionString: redis://127.0.0.1:6379
name: Redis
description: ""
condition: ""
sampleData: {}

CUSTOM

Redis step custom configuration
stepType: redis
config:
actions:
- action: custom
options: {}
payload:
- SET
- key
- value
target: result
connectionString: redis://127.0.0.1:6379
name: Redis
description: ""
condition: ""
Flow Result
{
"doc": {
"result": "OK"
},
"errors": [],
"performance": {
"steps": [
{
"step": "redis",
"executionTime": 25
}
],
"executionTimeOfFlow": 26,
"timeMetric": "ms"
}
}
Redis CUSTOM Flow Example
    tags:
- general
steps:
- stepType: redis
config:
actions:
- action: custom
options: {}
payload:
- SET
- key
- value
target: result
connectionString: redis://127.0.0.1:6379
name: Redis
description: ""
condition: ""
sampleData: {}