Skip to content

Update node from another document #1817

Closed Answered by mikefarah
Hazzard17h asked this question in Q&A
Discussion options

You must be logged in to vote

By default, yq runs through documents one at a time (saves on memory), you can make it evaluate against all the documents by specifying eval-all/ea:

echo -e "a: apples\n---\nb: bob" | yq ea 'select(di==0).a = select(di==1) | select(di==0)'

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Hazzard17h
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