您好我正在成功运行shell mongo db命令,如下所示
db.main.find({starttime : {$gt :1477267200, $lt : 1477353600},id: "55567"}).pretty();
我想在php中使用等效语句并在下面尝试但不获取数据
$cursor=$collection->find(array('starttime' => array(array('$gt' => '1477267200'),array('$lte' => '1477353600'))),array('site_id'=> '55567'));
答案 0 :(得分:0)
$collection->find(array(
"site_id" => 5,
"starttime" => array('$gt' => 1477267200, '$lt' => 1477353600)));