MongoDB,退订文档列表中的Puling文档

时间:2018-08-09 11:39:31

标签: mongodb mongodb-query embedded-documents

我的时间表收集方案如下所示。如何从分组数组中提取一个分组文档?我需要从多个时间表文档中进行此操作。

  {  
   "_id":ObjectId("5b17cde1fb6e1319d48acea3"),
   "lectures":[  
      {  
         "_id":ObjectId("5b6bef5b43549d19d4af87bb"),
         "groups":[  
            {  
               "_id":ObjectId("5b6c1d8543549d02276c5030"),
               "group_id":ObjectId("5b20ac76fb6e135a054bc39b"),
               "start_date":               ISODate("2018-08-09T00:00:00               Z"),
               "week":0
            }
         ],
         "lesson_time_id":ObjectId("5b17cd8ffb6e136ede1edd00")
      },
      {  
         "_id":ObjectId("5b6c1d8543549d02276c5033"),
         "groups":[  
            {  
               "_id":ObjectId("5b6c1d8543549d02276c5032"),
               "group_id":ObjectId("5b1fd984fb6e13f5f24036cc"),
               "start_date":               ISODate("2018-08-09T00:00:00               Z"),
               "week":0
            }
         ],
         "lesson_time_id":ObjectId("5b17cd8ffb6e136ede1edd01")
      }
   ]
}

0 个答案:

没有答案