Skip to content

How to remove an entry matching a name key? #1025

Answered by mfn
mfn asked this question in Q&A
Discussion options

You must be logged in to vote

Ok, scientific breakthrough here 😬

+ $ yq eval '.images.[] | select(.name == "b")' example.yaml
name: b
newName: repo
newTag: tag2

next try:

+ $ yq eval 'del(.images.[] | select(.name == "b"))' example.yaml
resources:
  - resource1
images:
  - name: a
    newName: repo
    newTag: tag1

Did I just figure it out ? 👀

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mikefarah
Comment options

Answer selected by mikefarah
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants