mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-12 13:48:06 +00:00
453 B
453 B
Collect into Array
This creates an array using the expression between the square brackets.
Examples
Collect empty
Running
yq eval --null-input '[]'
will output
Collect single
Running
yq eval --null-input '["cat"]'
will output
- cat
Collect many
Given a sample.yml file of:
a: cat
b: dog
then
yq eval '[.a, .b]' sample.yml
will output
- cat
- dog