Maps values of an array. Use map_values to map values of an object.
map_values
Given a sample.yml file of:
- 1 - 2 - 3
then
yq 'map(. + 1)' sample.yml
will output
- 2 - 3 - 4
a: 1 b: 2 c: 3
Last updated 3 years ago
yq 'map_values(. + 1)' sample.yml
a: 2 b: 3 c: 4