【发布时间】:2016-06-14 07:22:54
【问题描述】:
我有一个像"estdate" : "2016-06-14T06:49:00.000Z"这样的mongodb记录
我正在编写以下php代码来查询时间
$from=$start = new MongoDate(strtotime('2016-04-11 00:00:00'));
$to=new MongoDate(strtotime('2016-06-18 00:00:00'));
$filterpatient = array("order.patientinfo.order_id" => $ordertext,"order.orderitem.estdate" => array('$gte' =>$from, '$lte' => $to));
$cursor = $collection->find($filterpatient)->sort(array('_id'=>-1));
但这没有给出任何结果。
【问题讨论】:
标签: php mongodb mongodb-query