Skip to main content

Mutate the value where Key Equal

Mutate the value of a key.

Example

This example shows how to use the MutateValueWhereKeyEq transformation to mutate the value of a key if the key exists.

{
"operation": "mutate_value_where_key_eq",
"arguments": {
"key": "field1",
"value": "new_value"
}
}

Given the input record:

{
"field1": "old_value",
"another_field": "another_value"
}

The output record will be:

{
"field1": "new_value",
"another_field": "another_value"
}

If the key does not exist:

Given the input record:

{
"field2": "some_value",
"another_field": "another_value"
}

The output record will be unchanged:

{
"field2": "some_value",
"another_field": "another_value"
}