Skip to content

Commit 4444f8a

Browse files
Merge pull request #1675 from ilianiliev-redis/RDSC-3627-writhing-to-multiple-keys
Adding example for writhing to multiple keys
2 parents 58ec1f6 + 24c2ee6 commit 4444f8a

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: Writing to multiple keys
3+
alwaysopen: false
4+
categories:
5+
- docs
6+
- integrate
7+
- rs
8+
- rdi
9+
description: null
10+
group: di
11+
linkTitle: Writing 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 results to multiple keys, you can do so by defining multiple `redis.write` subsections in the `output` section of the job file. Each instance of `redis.write` 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)