Reputation: 12500
I have some data that looks like:
{
"hello": {
"foo": "x",
"y": "z"
},
"foo": "a",
"bar": {
{
"foo": "b"
}
}
}
How can I get all values with key foo
, wherever they are?
Upvotes: 1
Views: 50
Reputation: 3604
You can search using recursive decent
jq '..|.foo?'
https://jqplay.org/s/Xp64LfJFBc
https://stedolan.github.io/jq/manual/#RecursiveDescent:..
Upvotes: 2