Group Query result by Month and Year in MongoTemplate

{
id:0025
status:“SUCCESS”
joinDateUtc:1626674099562
amount:“500”
}

How to group By Month, Year, and Date according to the success status. No.of Users have been joined in a particular month or year. How can achieve that…?. Here, the date has been stringified.