Collect into Array
This creates an array using the expression between the square brackets.
Collect empty
Running
yq --null-input '[]'will output
[]Collect single
Running
yq --null-input '["cat"]'will output
- catCollect many
Given a sample.yml file of:
a: cat
b: dogthen
yq '[.a, .b]' sample.ymlwill output
- cat
- dogLast updated
Was this helpful?