How to do a Mongo aggregation query in Spring Data?
问题 It's the first time I am using Mongo in Java and I am having some problems with this aggregation query. I can do some simple queries in Mongo for Spring with @Query annotation in my Repository interface which extends the MongoRepository<T, ID> . It would be helpful to know which approach to take when you do long aggregations in Spring-Data. db.post.aggregate([ { $match: {} }, { $lookup: { from: "users", localField: "postedBy", foreignField: "_id", as: "user" } }, { $group: { _id: { username: