The initial JSON data:
{
"data": {
"count_at_hub": [
{
"hub": "A",
"date": "",
"size": "1",
"count": 141
},
{
"hub": "A",
"date": "",
"size": "2",
"count": 44
},
{
"hub": "A",
"date": "",
"size": "3",
"count": 3
},
{
"hub": "A",
"date": "",
"size": "0",
"count": 1446
},
{
"hub": "B",
"date": "",
"size": "1",
"count": 202
},
{
"hub": "B",
"date": "",
"size": "0",
"count": 2082
},
{
"hub": "B",
"date": "",
"size": "3",
"count": 11
},
{
"hub": "B",
"date": "",
"size": "2",
"count": 53
}
],
"Part B":[
{
}
]
},
"success": true,
"errors": [],
"e": {}}
I am planning to reorganize the structure as follows:
{
"data": {
"count_at_hub": [
{
"hub": "A",
"date": "",
"size1": 141,
"size2": 44,
"size3": 3,
"size4": 1446
},
{
"hub": "B",
"date": "",
"size1": 202,
"size2": 2082,
"size3": 11,
"count": 53
}
],
"Part B":[
{
}
]
},
"success": true,
"errors": [],
"e": {}}
Essentially, I aim to group all counts for each hub under the same object. How should I proceed with this transformation?
Considering a large dataset, will converting the JSON to the modified format result in slower loading times compared to having JavaScript iterate through the original file for creating a dashboard?