Scala Play Salat Aggregate Example
问题 I am using Scala Play 2.x with MongoDB in backend and I must confess that Salat has wonderful support for mongo CRUD operations. But so far I didn't find any good example of how I can call mongo aggregate function using SALAT like $unwind, $match, $group or aggregate pipeline. For example db.posts.aggregate([ { $unwind :"$tag" }, { $group : { _id :"$tags", count : {$sum :1} } }, { $sort : {$post :-1} }, { $limit :1 } ]) UPDATE (ALTERNATIVE) I didn't find any help which systematically explain