Filtering, reducing firebase database

Hello guys! Unfortunately i am really bad in filtering and stuff like that so i have a problem with my firebase database.

You can see on the picture that i have objects in the “/fogasok”. I would like to go through these objects and sum the “suly” value for each month (you can see the “datum” value is the date) so i can make a chart from it.

So here it the sum for the “suly”. But how could i rewrite this so i would get an array like this:

January sum: 21
February sum: 26