Delete
Deletes matching entries in maps or arrays.
Delete entry in map
Given a sample.yml file of:
a: cat
b: dogthen
yq 'del(.b)' sample.ymlwill output
a: catDelete nested entry in map
Given a sample.yml file of:
a:
a1: fred
a2: froodthen
yq 'del(.a.a1)' sample.ymlwill output
Delete entry in array
Given a sample.yml file of:
then
will output
Delete nested entry in array
Given a sample.yml file of:
then
will output
Delete no matches
Given a sample.yml file of:
then
will output
Delete matching entries
Given a sample.yml file of:
then
will output
Recursively delete matching keys
Given a sample.yml file of:
then
will output
Last updated
Was this helpful?