How can avoid adding null to missing select keys? #2696
Unanswered
ldosdevel01-max
asked this question in
Q&A
Replies: 1 comment
-
|
This would work (the missing search key is not added with null value to index 0): yq -i e '(select(documentIndex == 1) | .c.d) = [1,2,3]' ~/1.yamlbut the document index is not known, only the search-key value is known. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
results:
expected (without the added null value of missing select key):
Beta Was this translation helpful? Give feedback.
All reactions