You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! Thanks for this elegant and useful tool. I'm wondering whether I've tickled a bug or am just holding yq wrong. I'm trying to delete array elements whose parents' parents match a wildcard, but running into surprising behavior when some of those parents are aliases of others.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello! Thanks for this elegant and useful tool. I'm wondering whether I've tickled a bug or am just holding
yq
wrong. I'm trying to delete array elements whose parents' parents match a wildcard, but running into surprising behavior when some of those parents are aliases of others.Example:
I expected
.a."b.ext".things
to still contain a single element "b".If I add a third element
"c"
to that array,del
deletes two elements as before but leaves the third:I can see why
del
might want to delete the 0th element ofa."b.ext".things
twice, once forb.ext
and once forc.ext
through its alias:... but it's still surprising to see an element deleted that doesn't match
. == "a"
.Workaround
I can interpose
select(alias == "")
to avoid traversing aliases:Beta Was this translation helpful? Give feedback.
All reactions