how to manipulate the array in javascript? : I have a json response from the mongodb in this format;

[{
    "_id" : 4,
    "status" : [ 
        {
            "status" : "Closed",
            "count" : 2
        }, 
        {
            "status" : "Open",
            "count" : 17
        }
    ],
    "count" : 19
},
{
    "_id" : 3,
    "status" : [ 
        {
            "status" : "Closed",
            "count" : 6
        }, 
        {
            "status" : "Open",
            "count" : 22
        }
    ],
    "count" : 28
}]

I want to manipulate this into an array of object so it becomes easy for me to pass them onto the highcharts.

categories: ['3', '4']

series: [{
            name: 'Open',
            data: [20,24]
        }, {
            name: 'Closed',
            data: [40,55]
        }]


Basically i want to group all the "open" and "closed" with respect to the categories, so it becomes easy for me to include them in the highcharts.

Thanks !

