From 43b0929a9c322021d63ce78169cce5315a9dbf87 Mon Sep 17 00:00:00 2001 From: Ilian Iliev Date: Fri, 6 Jun 2025 15:49:36 +0300 Subject: [PATCH] Adding example for writhing to multiple keys --- .../redis-writing-to-multiple-keys.md | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 content/integrate/redis-data-integration/data-pipelines/transform-examples/redis-writing-to-multiple-keys.md diff --git a/content/integrate/redis-data-integration/data-pipelines/transform-examples/redis-writing-to-multiple-keys.md b/content/integrate/redis-data-integration/data-pipelines/transform-examples/redis-writing-to-multiple-keys.md new file mode 100644 index 0000000000..fa059682d5 --- /dev/null +++ b/content/integrate/redis-data-integration/data-pipelines/transform-examples/redis-writing-to-multiple-keys.md @@ -0,0 +1,41 @@ +--- +Title: Writhing to multiple keys +alwaysopen: false +categories: + - docs + - integrate + - rs + - rdi +description: null +group: di +linkTitle: Writhing to multiple keys +summary: Redis Data Integration keeps Redis in sync with the primary database in near + real time. +type: integration +weight: 100 +--- + +If you want to write the results to multiple keys, you can do that by defining multiple `redis.write` items `output` section of the job file. Each section can specify a different key, data format, and other parameters. For example, you can create two different keys for the same data, one with a default key format and another with a custom key format and mapping. + +```yaml +output: + - uses: redis.write + with: + # Setting data_type to JSON and using the default key format + data_type: json + + - uses: redis.write + with: + data_type: json + + # Defining a custom key format + key: + language: jmespath + expression: concat(['events-simplified:id:', id]) + + # And defining a custom mapping + mapping: + - id: id + - name: name + - location: location +```