{ "_id" : "aBAj43ZZKFLyRucx33", "name" : "李三", "createAt" : ISODate("2016-12-16T10:31:37.501Z") }
如上的记录,如何返回根据 createAt 字段返回今天,昨天,本周,上周,本月,上月用户注册的聚合吗?
参考: https://docs.mongodb.com/manual/reference/operator/aggregation/
![]() | 1 gdsagdada 2016-12-27 17:47:53 +08:00 出门左转 stackoverflow ,问前先搜 |
![]() | 2 a342191555 2016-12-27 18:16:34 +08:00 project: "today" : {"$push" : ...} "yesterday" : {"$push" : ...} ....... |