-
Issue: Version of yq: 4.13.2 Input Yaml
service2.yml:
master.yml:
Command
Actual behavior
Expected behavior
I like to overwrite array elements with service1.yml and service2.yml "services". Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
What you're trying to do is a bit cleverer than a normal merge, as merge doesn't have anyway of knowing that 'name' is special key to match on. There's an example here in the docs of how to do it, note that in the docs it uses 'a' as the matching key name where as you want 'name': |
Beta Was this translation helpful? Give feedback.
-
I ended up first deleting all array elements by matching Key name and then using Append array elements. I was able to achieve my objective by writing this in a Bash script.
|
Beta Was this translation helpful? Give feedback.
I ended up first deleting all array elements by matching Key name and then using Append array elements. I was able to achieve my objective by writing this in a Bash script.