Let's say I have the following array:
[
{
"a": 1,
"b": 2,
"c": 3,
"d": 4
},
{
"a": 10,
"b": 20,
"c": 30,
"d": 40
},
{
"a": 100,
"b": 200,
"c": 300,
"d": 400
}
]
I want to generate a new array with just the a and b keys. I know I can do it like this:
ARRAY | jq '. | map({ a: .a, b: .b })'
I'm not renaming any of the keys so having to type a and b seems a bit verbose. Is there a cleaner way to do this?