Let's suppose I have a JSON like this:
[
{
"a": 1,
"l": [
{"b": "z"},
{"b": "x"}
]
},
{
"a": 2,
"l": [
{"b": "c"}
]
}
]
I want to collect the data from all embedded arrays and to get an array of all objects with "a" and "b" values. For the JSON above the result should be:
[
{"a": 1, "b": "z"},
{"a": 1, "b": "x"},
{"a": 2, "b": "c"}
]
What JQ expression do I need to try to solve the issue?