Skip to main content

Rename Key Where Value Equal

Rename a key where the value is equal to a specified value.

Example

This example shows how to use the RenameKeyWhereValueEq transformation to rename a key if the value equals a specified value.

{
"operation": "rename_key_where_value_eq",
"arguments": {
"key": "old_key",
"value": "target_value",
"new_key": "new_key"
}
}

Given the input record where the value matches:

{
"old_key": "target_value",
"another_field": "another_value"
}

The output record will be:

{
"new_key": "target_value",
"another_field": "another_value"
}

Given the input record where the value does not match:

{
"old_key": "different_value",
"another_field": "another_value"
}

The output record will be unchanged:

{
"old_key": "different_value",
"another_field": "another_value"
}