You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- The `before` object will be `null` for `insert` and `create` operations, and the `after` object will be `null` for `delete` operations. This means that if you are building the output key manually, you should account for this and ensure that you are not trying to access fields from a `null` object. Example:
109
+
110
+
```yaml
111
+
source:
112
+
table: addresses
113
+
row_format: full
114
+
115
+
output:
116
+
- uses: redis.write
117
+
with:
118
+
key:
119
+
language: jmespath
120
+
# The following pattern will fail for delete operations. In those cases `after` is null, the resulting key will
121
+
# be 'addresses:None' and the key won't be removed from the target
122
+
# expression: concat(['addresses:', after.ID])
123
+
124
+
# This pattern work for all operations, by using the ID from the `after` object if available,
125
+
# and do a fallback to the ID from the `before` object if not.
Please note that `key` should not be used in combination with `row_format: full` and more than one output, as the `key` object will be overwritten by the previous output. This is a known limitation of the current implementation and is subject to change in future versions.
133
+
134
+
135
+
- The final result of the processing, that will be stored in the output, is the value of the `after` object, so you have to reference the fields using the `after` prefix unless you change the output structure in a transformation step. This also means that when adding new fields, you have to prefix them with `after.` to ensure that they are added to the correct part of the output. Example:
136
+
137
+
```yaml
138
+
source:
139
+
table: addresses
140
+
row_format: full
141
+
142
+
transform:
143
+
- uses: add_field
144
+
with:
145
+
field: after.city_state # use this to add the new field to the final output
146
+
# field: city_state # use this if you need a temporary field in the transformation steps, but not in the final output
0 commit comments