How to extract json's values as JSON array with jq?
For example for the below json:
{
"a" : 1,
"b" : 2
}
I would like to extract values as JSON array:
[
1,
2
]
How to do it with jq?
I found a way to extract keys only in the docs:
echo $json | jq keys returns:
[
"a",
"b"
]
a,b, need to be double quoted forjqto parse it as a valid JSONkeysfilter