mirror of
https://github.com/mikefarah/yq.git
synced 2025-01-23 22:25:42 +00:00
Update multiply docs
This commit is contained in:
parent
406bbb8ca4
commit
d27fb0ec78
@ -15,9 +15,16 @@ You can control how objects are merged by using one or more of the following fla
|
||||
- `?` only merge _existing_ fields
|
||||
- `n` only merge _new_ fields
|
||||
|
||||
### Merging files
|
||||
|
||||
### Merge two files together
|
||||
This uses the load operator to merge file2 into file1.
|
||||
```bash
|
||||
yq '. *= load("file2.yml")' file1.yml
|
||||
```
|
||||
|
||||
### Merging all files
|
||||
Note the use of `eval-all` to ensure all documents are loaded into memory.
|
||||
|
||||
```bash
|
||||
yq eval-all 'select(fileIndex == 0) * select(fileIndex == 1)' file1.yaml file2.yaml
|
||||
yq eval-all '. as $item ireduce ({}; . * $item )' *.yml
|
||||
```
|
||||
|
@ -15,11 +15,18 @@ You can control how objects are merged by using one or more of the following fla
|
||||
- `?` only merge _existing_ fields
|
||||
- `n` only merge _new_ fields
|
||||
|
||||
### Merging files
|
||||
|
||||
### Merge two files together
|
||||
This uses the load operator to merge file2 into file1.
|
||||
```bash
|
||||
yq '. *= load("file2.yml")' file1.yml
|
||||
```
|
||||
|
||||
### Merging all files
|
||||
Note the use of `eval-all` to ensure all documents are loaded into memory.
|
||||
|
||||
```bash
|
||||
yq eval-all 'select(fileIndex == 0) * select(fileIndex == 1)' file1.yaml file2.yaml
|
||||
yq eval-all '. as $item ireduce ({}; . * $item )' *.yml
|
||||
```
|
||||
|
||||
{% hint style="warning" %}
|
||||
|
Loading…
Reference in New Issue
Block a user