We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
macOS 15.2
$ yq --version yq (https://github.com/mikefarah/yq/) version v4.45.1
When a node value is copied into a sequence, it cannot be deleted:
$ echo 'foo: bar' | yq '.a = [.foo, "baz"] | .b = ["bar", "baz"] | del(.a[0], .b[0])' foo: bar a: - bar - baz b: - baz
The additional literal sequence elements can be deleted normally:
❯ echo 'foo: bar' | yq '.a = [.foo, "baz"] | .b = ["bar", "baz"] | del(.a[1], .b[1])' foo: bar a: - bar b: - bar
The text was updated successfully, but these errors were encountered:
Workaround: concatenate with the empty string (note: the order matters!)
❯ echo 'foo: bar' | yq '.a = ["" + .foo, "baz"] | .b = ["bar", "baz"] | del(.a[0], .b[0])' foo: bar a: - baz b: - baz
Just showing that the concatenation produces the correct string value:
❯ echo 'foo: bar' | yq '.a = ["" + .foo, "baz"] | .b = ["bar", "baz"] | del(.a[1], .b[1])' foo: bar a: - bar b: - bar
Sorry, something went wrong.
No branches or pull requests
macOS 15.2
When a node value is copied into a sequence, it cannot be deleted:
The additional literal sequence elements can be deleted normally:
The text was updated successfully, but these errors were encountered: