-
I am doing an in place replacement of a key, but since the yaml is more then just one document (a multi line yaml) it is replacing it in the first document, and then adding it to the next document? How do I just do the first? I saw select statements in other discussions, but do not understand. |
Beta Was this translation helpful? Give feedback.
Answered by
mikefarah
Feb 22, 2025
Replies: 1 comment 1 reply
-
yq eval -i '(select(.bootstrapTokens) | .bootstrapTokens[0].token) = "new value"' |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just pipe the select statements together, like consecutive filters:
Ref: https://mikefarah.gitbook.io/yq/operators/document-index