[![Sample Data Set](https://i.stack.imgur.com/niy0z.png)](https://i.stack.imgur.com/niy0z.png)

I want to count no of `green,red,amber` in each month (ie: grouping by month)like in the below eg:

```
{_id:2,Green:20,Red:12,Amber:23}

```

say \_id represents the month (2:Feb)

note:- I am retrieving Data from mongodb and the Date column is in ISO date type format

Can anyone help me?