This creates an array using the expression between the square brackets.
Running
yq --null-input '[]'
will output
[]
yq --null-input '["cat"]'
- cat
Given a sample.yml file of:
a: cat b: dog
then
Last updated 3 years ago
yq '[.a, .b]' sample.yml
- cat - dog