Skip to content

Adding example for writhing to multiple keys #1675

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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
```