-
|
Given a yaml spec:
some: wombatin V3, the following worked yq w -i file.yaml 'spec.config[+]' agiving spec:
some: wombat
config:
- a Subsequently we can add more elements to the array by running the same What's the corresponding command in V4? Doing yq e -i '.spec.config + "a"' file.yamlgives Error: !!null cannot be added to !!strcould do yq e -i '.spec.config[0] = a' file.yamlbut this requires maintaing the index, no? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
|
I'd use the alternative operator with add: |
Beta Was this translation helpful? Give feedback.
-
|
@mikefarah Just discovered that this, although worked in 4.4.0, does not work in 4.5.0, 4.6.0 .. |
Beta Was this translation helpful? Give feedback.
-
|
How does the formatting work on this @mikefarah? when I later do |
Beta Was this translation helpful? Give feedback.
I'd use the alternative operator with add: