我試圖聚合使用部門和狀態的員工來計算每個狀態的總和。從這: {
name : "Employee_1",
department: "hr",
status : "exist"
},
{
name : "Employee_2",
department: "acme",
status : "absent"
},
{
name
我怎麼能在MongoDB中執行此SQL查詢 SELECT TOP 100 * FROM Tracks
WHERE ID IN (SELECT MAX(ID) FROM Tracks WHERE UserID IN ([UserIDs...]) GROUP BY UserID)
軌道結構: Tracks[{_id, userId, {lat, lon}, dateCreate, ...}, .