mirror of
https://github.com/mikefarah/yq.git
synced 2024-12-19 20:19:04 +00:00
Better formatting of merge arrays example
This commit is contained in:
parent
de3110cf16
commit
6c347598ad
@ -262,8 +262,9 @@ And another sample another.yml file of:
|
|||||||
```
|
```
|
||||||
then
|
then
|
||||||
```bash
|
```bash
|
||||||
yq eval-all '((.[] | {.a: .}) as $item ireduce ({}; . * $item )) as $uniqueMap
|
yq eval-all '
|
||||||
| ( $uniqueMap | to_entries | .[]) as $item ireduce([]; . + $item.value)
|
((.[] | {.a: .}) as $item ireduce ({}; . * $item )) as $uniqueMap
|
||||||
|
| ( $uniqueMap | to_entries | .[]) as $item ireduce([]; . + $item.value)
|
||||||
' sample.yml another.yml
|
' sample.yml another.yml
|
||||||
```
|
```
|
||||||
will output
|
will output
|
||||||
|
Loading…
Reference in New Issue
Block a user