I have an array in the following format
[
{
"duedate": "15-feb-2014",
"alias": "electronus",
"agent": "anonymous",
"name": ""
},
{
"duedate": "15-feb-2014",
"alias": "luminous",
"agent": "anonymous",
"name": ""
},
{
"duedate": "16-feb-2014",
"alias": "GSM",
"agent": "anonymous",
"name": ""
}
]
Underscore group by method allows me to group the array using the properties and in my case using due date. This will return an array like this
{
"15-Feb-2014": [
{
"duedate": "15-feb-2014",
"alias": "electronus",
"agent": "anonymous",
"name": ""
},
{
"duedate": "15-feb-2014",
"alias": "luminous",
"agent": "anonymous",
"name": ""
}
],
"16-Feb-2014": [
{
"duedate": "16-feb-2014",
"alias": "GSM",
"agent": "anonymous",
"name": ""
}
]
}
Is there a possibility that I could have an array like this:
[
{
"duedate": "15-feb-2014",
"myValues": [
{
"duedate": "15-feb-2014",
"alias": "electronus",
"agent": "anonymous",
"name": ""
},
{
"duedate": "15-feb-2014",
"alias": "luminous",
"agent": "anonymous",
"name": ""
}
]
},
{
"duedate": "16-feb-2014",
"myValues": [
{
"duedate": "16-feb-2014",
"alias": "GSM",
"agent": "anonymous",
"name": ""
}
]
}
]
So I could have multiple array values inside each due date so I could parse it to fill a template which I can't change.
I have been struggling with this for quite some time. Any help would be gratefully recieved.