我想简单地计算文件。执行以下操作的正确方法是什么:
db.my_collection.aggregate({
$match: { // go by the indexed field
date: {
$gte: new Date(2013,1,20),
$lte: new Date(2013,1,27)
}
}
},{
$match: { // go by some other field
someField: 'someValue'
}
},{
$count: { // $sum? $group? $anythingElse?
// ???????
}
})