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
bash-3.2$ A="[cat, bat]" yq 'env(A)[] as $a ireduce(.; del(.[] | select(.[] == $a)))' test.yaml
- b: dog
- c: bat
Expected behavior
bash-3.2$ A="[cat, bat]" yq 'env(A)[] as $a ireduce(.; del(.[] | select(.[] == $a)))' test.yaml
- b: dog
Additional context
The behavior is very weird as the input variable A changed; another strange behavior is that: I can't delete all the elements, even deleting the array index 0 every time.
bash-3.2$ A="[cat, bat, dog]" yq 'env(A)[] as $a ireduce(.; del(.[0]))' test.yaml
- b: dog
The text was updated successfully, but these errors were encountered:
Describe the bug
When I use
delete
operator in theireduce
block, the del doesn't work as I expected.Version of yq: 4.44.3
Operating system: mac
Installed via: homebrew
Input Yaml
test.yml:
Command
The command you ran:
Actual behavior
Expected behavior
Additional context
The behavior is very weird as the input variable
A
changed; another strange behavior is that: I can't delete all the elements, even deleting the array index 0 every time.The text was updated successfully, but these errors were encountered: