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. 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, as shown in the example below:
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 works for all operations, by using the ID from the `after` object if it is available,
125
+
# and falling back to the ID from the `before` object if not.
Please note that you should not use `key` 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 (which is what will be stored in the output) is the value of the `after` object. This means you must reference the fields using the `after` prefix unless you change the output structure in a transformation step. Also, when you add new fields, you must prefix them with `after.` to ensure that they are added to the correct part of the output:
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