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
It would be great to be able to control merge function behavior when there are keys with the same name in "to" and "from" objects.
Current behavior for simple values is to use the value from object that enjoys higher precedence.
What I think could be sometimes helpful to be able to do instead:
rename the key
merge / concatenate the values from both keys
store the conflicting keys in some other object
Example:
event:
{
"json": {
"msg": "bar"
},
"msg": "foo"
}
program:
. = merge!(del(.json), .)
output:
{
"msg": "foo"
}
changing the precedence
program:
. = merge!(.,del(.json))
output:
{
"msg": "bar"
}
The text was updated successfully, but these errors were encountered:
prein
changed the title
[feature enhancement] Additional merge startegies
[feature enhancement] Additional merge strategies
Mar 20, 2024
It would be great to be able to control merge function behavior when there are keys with the same name in "to" and "from" objects.
Current behavior for simple values is to use the value from object that enjoys higher precedence.
What I think could be sometimes helpful to be able to do instead:
Example:
event:
program:
output:
changing the precedence
program:
output:
The text was updated successfully, but these errors were encountered: