Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete and not equals filter don't work for multiple documents #1377

Closed
zhoujoetan opened this issue Oct 10, 2022 · 2 comments
Closed

Delete and not equals filter don't work for multiple documents #1377

zhoujoetan opened this issue Oct 10, 2022 · 2 comments
Labels

Comments

@zhoujoetan
Copy link

Describe the bug
Delete such as del(. | select(.a1=="abc")) and not equals filter such as del(. | select(.a1!="abc")) does not work for yaml files with multiple documents:

Version of yq: 4.27.5
Operating system: mac/
Installed via: pip3 install

Input Yaml
Concise yaml document(s) (as simple as possible to show the bug, please keep it to 10 lines or less)
data1.yml:

---
a1: abc
a2: def
---
a1: abd
a2: def

Command
The command you ran:

yq 'del(. | select(.a1=="abc"))' data1.yml

Actual behavior

---
a1: abc
a2: def
---
a1: abd
a2: def

Expected behavior

---
a1: abc
a2: def

Command 2
The command you ran:

yq 'del(. | select(.a1!="abd"))' data1.yml

Actual behavior

---
a1: abc
a2: def
---
a1: abd
a2: def

Expected behavior

---
a1: abc
a2: def

Additional context
Add any other context about the problem here.

@mikefarah
Copy link
Owner

Thanks for raising, will fix in the next release

@mikefarah
Copy link
Owner

Fixed in 4.28.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants