Given I have a list of objects:
{
"alpha": {
"bytes": {
"value": 4789440
},
"doc_count": 7723
},
"beta": {
"bytes": {
"value": 4416862639
},
"doc_count": 1296
}
}
Is there a way using jq to get an array representation of this, such as:
[
{
"key": "alpha",
"bytes": {
"value": 4789440
},
"doc_count": 7723
},
{
"key": "beta",
"bytes": {
"value": 4416862639
},
"doc_count": 1296
}
]
{"a":1}, not in arrays (["a":1]is not valid). You can, however, have an array of objects[{"a":1},{"b":2}]if this is what you want.