-
-
Notifications
You must be signed in to change notification settings - Fork 723
Open
Description
I am not 100% certain that this is a bug instead of me not understanding some special behaviour:
printf '{"a":1}\n{"a":2}\n{"a":3}\n' | yq --input-format=json --output-format=json ea '[.] | map(. * {"b":0})'Returns
[
{
"a": 1,
"b": 0
},
{
"a": 1,
"b": 0
},
{
"a": 1,
"b": 0
},
{
"a": 2,
"b": 0
},
{
"a": 2,
"b": 0
},
{
"a": 2,
"b": 0
},
{
"a": 3,
"b": 0
},
{
"a": 3,
"b": 0
},
{
"a": 3,
"b": 0
}
]Whereas I would have expected it to output
[{"a": 1, "b": 0}, {"a": 2, "b": 0}, {"a": 3, "b": 0}]which one gets when using this:
printf '{"a":1}\n{"a":2}\n{"a":3}\n' | yq --input-format=json --output-format=json ea '[.]' | yq 'map(. * {"b":0})'So it appears to be related to the eval-all, but I don't understand what is going on.