I want to convert the below object to the expected one. I am using the Javascript/node js code to do it, but could not able to achieve it. I have tried so many ways but did not achieve it.
Original:
{
"0": {
"buildVersion": {
"0": "6.15",
"1": "6.16"
},
"market": "CORE"
},
"1": {
"buildVersion": {
"0": "6.15",
"1": "6.16"
},
"market": "US"
},
"2": {
"buildVersion": {
"0": "6.15.1",
"1": "6.16.2"
},
"market": "CA"
}
}
Expected:
[
{
"market": "CORE",
"buildVersion": [
"6.15",
"6.16"
]
},
{
"market": "US",
"buildVersion": [
"6.15",
"6.16"
]
},
{
"market": "CA",
"buildVersion": [
"6.15.1",
"6.16.2"
]
}
]