I think it is important for you to learn more about MongoDB query and aggregation features before trying to "hide" the query into a ORM/ODM like Hibernate or Spring.
The "equivalent" of the group by in MongoDB is done using the "Aggregation Pipeline" feature documented here:
This feature allows you to group, calculate, transform/project the documents.
A quick example of what you have done in SQL may look like the following aggregation commands:
db.activity_user.aggregate([
{ $match : {platform : 01} },
{ $group : { _id : "$activity_date" , total : { $sum : 1 }} },
{ $project : { "total" : 1, "date" : "$_id" , _id : 0} }
])
or
db.activity_user.aggregate([
{ $match : {platform : 01} },
{ $group : { _id : { day : { $dayOfMonth : "$activity_date" } , month : { $month : "$activity_date" } , year : { $year : "$activity_date" } }, total : { $sum : 1 }} },
{ $project : { "total" : 1, "date" : "$_id" , _id : 0} }
])
These queries are not exactly the same but I have written them to show you a way to start to learn Aggregation Pipeline more or less on your data.
Once you have more experience with the MongoDB aggregation framework, you can look how it is integrate with the Java API that you want to use: