Reputation: 243
Can someone help me extract values from json like below:
[
[
{
"name": "x",
"age": "y",
"class": "z"
}
]
]
I would like to extract age
from the above json using jq
Upvotes: 3
Views: 59
Reputation: 116957
The pedestrian way:
.[] | .[] | .age
The briefer way:
.[][].age
Another possibility to consider (it has different semantics) would be:
.. | .age?
Upvotes: 2