mirror of
https://github.com/mikefarah/yq.git
synced 2024-12-19 20:19:04 +00:00
improved v3 merge docs
This commit is contained in:
parent
1bb6132620
commit
8c2488d25f
@ -118,10 +118,12 @@ yq 'del(.a.b.c)' sample.yaml
|
||||
|
||||
### Merging documents
|
||||
|
||||
Like `jq`, merge is done via the multiply operator.
|
||||
Like `jq`, merge is done via the multiply operator. In yq, the merge operator can take extra options to modify how it works.
|
||||
|
||||
For `v3` compatability, use the `n` option to only merge in new fields.
|
||||
|
||||
```bash
|
||||
yq '. * load("file2.yaml")' file1.yaml
|
||||
yq '. *n load("file2.yaml")' file1.yaml
|
||||
```
|
||||
|
||||
See the [multiply documentation](https://mikefarah.gitbook.io/yq/operators/multiply-merge) for more example and options.
|
||||
|
Loading…
Reference in New Issue
Block a user