After analyzing the JSON data below:
"rows": [{
"createdDate": "3/11/2016",
"createdBy": "Bob"
},{
"createdDate": "3/12/2016",
"createdBy": "Megan"
},{
"createdDate": "3/12/2016",
"createdBy": "Bob"
},{
"createdDate": "3/13/2016",
"createdBy": "Sam"
},{
"createdDate": "3/11/2016",
"createdBy": "Bob"
},]
I am in need of a way to group and count different properties for charting purposes. For example, I want output based on 'createdBy' as shown below:
"result": [{
"key": "Bob",
"value": 3,
},{
"key": "Megan",
"value": 1,
},{
"key": "Sam",
"value": 1,
},
Although I attempted to use _groupBy from underscore library, I was unable to achieve the desired result with my JSON data manipulation.