MySQL中可以做 JOIN, GROUP BY, .. 但在Mongodb就必須靠 aggregation 像Left outer join在Mongodb要用特別的operator : $lookup 官網有提供一些簡單的MySQL to Mongodb aggregate的語法範例 https://docs.mongodb.com/v3.2/reference/sql-aggregation-comparison/ 小舉例 db.collection('collName').aggregate([ { $match: matchQuery // 搜尋條件式, 符合的documents傳給下個階段 }, { $project: { // 將上個階段的documents取出指定欄位傳給下個階段 user: 1, place: 1, createdAt: 1 } }, { $group: { // 將上個階段的documents給group成指定的物件 _id: "$user", // _id 是必須要有的 place: { // 要輸出的place欄位是陣列 [ { _id: xxx }, { _id: xxx}, .. ] $push: { _id: "$place" } } } }, { $sort: { createdAt: -1 } }, { $limit: limit } ], function(err, aggregations) { }); 目前Aggregate在Mongodb原生的套件中沒有提