So I came up with a query that I\'m not really sure how to translate into Spring Data. This is the query:
db.collection.aggregate([{ { $group: {