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

Select not returning results if the first match is false #958

Closed
mikefarah opened this issue Oct 7, 2021 · 2 comments
Closed

Select not returning results if the first match is false #958

mikefarah opened this issue Oct 7, 2021 · 2 comments
Labels

Comments

@mikefarah
Copy link
Owner

mikefarah commented Oct 7, 2021

Describe the bug
A clear and concise description of what the bug is.

Note that any how to questions should be posted in the discussion board and not raised as an issue.

Version of yq: 4.13.3

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

servers:
  - name: server-1
    tags:
      - foo
  - name: server-2
    tags:
      - bar
  - name: server-3
    tags:
      - foo
      - bar

Command
The command you ran:

yq e '.servers[] | select(.tags[] | contains("bar")) | .name' test.yaml

Actual behavior

server-2

Expected behavior

server-2
server-3

Additional context
Add any other context about the problem here.

mikefarah added a commit that referenced this issue Oct 7, 2021
@mikefarah
Copy link
Owner Author

Raised on behalf of @mexoboy

@mikefarah
Copy link
Owner Author

Fixed in 4.13.4

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

1 participant