面试题答案
一键面试db.collection.aggregate([
{
$group: {
_id: {
department: "$department",
project: "$project"
},
count: { $sum: 1 }
}
}
]);
db.collection.aggregate([
{
$group: {
_id: {
department: "$department",
project: "$project"
},
count: { $sum: 1 }
}
}
]);