我正在使用laravel 5.1和jessenger mongodb包进行工作。我正在使用原始查询来获取数据,但我不知道如何在查询中使用日期,因为目前它返回空结果。
$resultSet = DB::connection('mongodb')->collection('wc_mycollection')->raw(function ($collection){
return $collection->aggregate([
[
'$match'=>[
'created_at'=>[
'$gte' => Previous day midnight,
'$lt' => Current Time
]
]
],
[
'$group' => [
'_id' => '$some_id',
]
]
]);
});
我该怎么办?