一个aggregate问题
想统计出时间段内每天的新增用户,这样写合适吗,可不可以不用$dateToString(在bae上报错了) Contact.aggregate([ {$project: { inserttime: { $dateToString: { format: ‘%Y-%m-%d’, date:’$date’ }}, num: {$sum: 1}, owner:’$owner’} }, {$match:{owner:_owner, inserttime:{$gte:_startTime+’ 00:00:01’},inserttime:{$lte:_endTime+’ 23:59:59’}}}, {$group:{_id:’$inserttime’,num:{$sum:1}}},
]).exec(function (err,doc) {