Replies: 2 comments
-
So under the '/backoffice' key, you have an array of objects. Question is, how do you know which elements in the array identify the same thing to merge them together? Once you know that, you can follow the example here: https://mikefarah.gitbook.io/yq/operators/multiply-merge#merge-arrays-of-objects-together-matching-on-a-key to merge... Hope that helps! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I have two files, I have created a merge, but some blocks was duplicated.
file1.yaml
file2.yaml
I'm using this command:
yq eval-all '. as $item ireduce ({}; . *+ $item)' file1.yaml file2.yaml > merged.yaml
The merge works fine, I want to merge the files, the file1 is the base, and file2 is the difference that I want to add.
But in the cases that I have some duplicated, the merge duplicate the result, like:
merged.yaml
There's any way do replace the values, example, the result that I need is:
Beta Was this translation helpful? Give feedback.
All reactions