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

Using a variable when traversing an array with yq causes strange behaviour #1566

Closed
mikefarah opened this issue Feb 21, 2023 Discussed in #1565 · 1 comment
Closed

Using a variable when traversing an array with yq causes strange behaviour #1566

mikefarah opened this issue Feb 21, 2023 Discussed in #1565 · 1 comment
Labels

Comments

@mikefarah
Copy link
Owner

Discussed in #1565

Originally posted by klimenkov February 22, 2023
Consider an example: echo [1, 2] | yq '[.[] | . as $x | $x + 1]'
it returns a list of 4 elements:

- 2
- 3
- 2
- 3

but I expected a list of 2 values [2, 3].
Is it a feature of product traversal? If so, how to make it flat?

@mikefarah
Copy link
Owner Author

Fixed in v4.31.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

1 participant