php – Laravel Mongodb Raw mongo查询日期
发布时间:2020-12-14 19:37:08 所属栏目:大数据 来源:网络整理
导读:我正在使用laravel 5.1并使用jessenger mongodb包. 我正在使用原始查询来获取数据,但我很困惑如何使用日期与目前它返回null结果. $resultSet = DB::connection('mongodb')-collection('wc_mycollection')-raw(function ($collection){ return $collection-ag
我正在使用laravel 5.1并使用jessenger
mongodb包.
我正在使用原始查询来获取数据,但我很困惑如何使用日期与目前它返回null结果. $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',] ] ]); }); 我该怎么办? 解决方法
试试这个选项:
'$match'=>[ 'created_at'=>[ '$gte' => new Date("2016-10-02T00:00:00.000Z"),'$lt' => new Date("2016-11-02T00:00:00.000Z") ] ] 看,如果有效. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐
- 从delphi中的另一个表单刷新DBGrid
- Learning English with EnglishClass101.com---1
- Vista / 7与Delphi7之间的本机提示/工具提示?
- delphi – 正确处理模态窗口“最小化”行为
- 如何在移动广告平台中IOS应用中集成插页式广告
- 编译lua,调用时出现unable to get ModulFileName
- delphi – TRegistry可以写REG_NONE值吗?
- attempted to return null from a method with a
- Symmetric Tree
- quick-lua新建一个HelloWorld的项目并且编译Andr
热点阅读