jq get object by key code example
Example 1: jq select
$ jq '.[] | select(.location=="Stockholm")' json
{
"location": "Stockholm",
"name": "Walt"
}
{
"location": "Stockholm",
"name": "Donald"
}
Example 2: jq list top nodes
echo '{"node1":"foo", "node2":"bar","node3": {"inner-node": "baz"}}' | jq '. |=keys'
[
"node1",
"node2",
"node3"
]