Using JQ 1.5 I've problems understanding the output of the alternative operator //
in a specific situation.
Given this input:
{"a": 42,"b": false,"c": null}
I expected the expression (.a, .b, .c, .d) // -1
to return this:
42-1-1-1
But in fact it returns this instead:
42
If I replace //
with another operator like <
then I indeed get four results instead of just one (the actual results are not important here, just their number):
> jq '(.a, .b, .c, .d) < -1' input.jsonfalsetruetruetrue
Note: The expression (.a, .b, .c, .d) | . // -1
returns the expected output. This is not the question. I'd like to know why the initial expression does not work.