Mongodb 使用where条件聚合查询

Mongodb 使用where条件聚合查询,mongodb,datetime,aggregation-framework,Mongodb,Datetime,Aggregation Framework,如何为Mongo转换以下SQL查询: 选择密钥ID,总和(数量) 从桌子上 其中日期类似于: db.myTable.aggregate([ { $match: { mydate: { $lte: new Date('12/01/1998') } } }, { $group: { _id: "$keyid", totalqty: { $sum: "$qty" } }} ]) 你能用这个吗- db.schoolexamregistration.aggregate([

如何为Mongo转换以下SQL查询:

选择密钥ID,总和(数量)
从桌子上
其中日期类似于:

db.myTable.aggregate([
  { $match: { mydate: { $lte: new Date('12/01/1998') } } },
  { $group: {
    _id: "$keyid",
    totalqty: { $sum: "$qty" }
  }}
])
你能用这个吗-

db.schoolexamregistration.aggregate([
    { $match: {"exam_session_id":"1523850138707"} },{
     $lookup:
       {
         from: "student",
         localField: "nic_ppt",
         foreignField: "nic_ppt",
         as: "student_detail"
       }
    }
  ])

你的收藏形式如何?