I am sorry if this is a duplicate question. But I couldn't be helped by the other similar questions yet. I have a JSON file like this:
[
{
age: 25,
id: 1,
name: "Iqbal Hussain",
receivedOn: "2014-10-21",
resource_uri: "/api/v1/student/1/",
sex: "M",
ugPercentage: 79
},{
age: 26,
id: 2,
name: "Anis Sarkar",
receivedOn: "2014-10-20",
resource_uri: "/api/v1/student/2/",
sex: "M",
ugPercentage: 67
},{
age: 25,
id: 3,
name: "Abumutalib Sheikh",
receivedOn: "2014-10-20",
resource_uri: "/api/v1/student/3/",
sex: "M",
ugPercentage: 59
},{
age: 24,
id: 4,
name: "Abhijeet Paul",
receivedOn: "2014-10-21",
resource_uri: "/api/v1/student/4/",
sex: "M",
ugPercentage: 62
}
]
I want it to be converted like this:
[
{
receivedOn: "2014-10-21",
total: 2
},{
receivedOn: "2014-10-20",
total: 2
}
]
where total is the number of objects having same receivedOn value