Skip to content

Commit 43b0929

Browse files
Adding example for writhing to multiple keys
1 parent 5c61408 commit 43b0929

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
Title: Writhing to multiple keys
3+
alwaysopen: false
4+
categories:
5+
- docs
6+
- integrate
7+
- rs
8+
- rdi
9+
description: null
10+
group: di
11+
linkTitle: Writhing to multiple keys
12+
summary: Redis Data Integration keeps Redis in sync with the primary database in near
13+
real time.
14+
type: integration
15+
weight: 100
16+
---
17+
18+
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.
19+
20+
```yaml
21+
output:
22+
- uses: redis.write
23+
with:
24+
# Setting data_type to JSON and using the default key format
25+
data_type: json
26+
27+
- uses: redis.write
28+
with:
29+
data_type: json
30+
31+
# Defining a custom key format
32+
key:
33+
language: jmespath
34+
expression: concat(['events-simplified:id:', id])
35+
36+
# And defining a custom mapping
37+
mapping:
38+
- id: id
39+
- name: name
40+
- location: location
41+
```

0 commit comments

Comments
 (0)