这个新的 MongoDB \ Driver \ Query 和MongoClient不能与php7.0一起使用的文档非常少
示例代码 -
$filter = array('$and'=> array(
array('code' => (string)$data[0]),
array('common_apps' => array($v_app => array('$exists'=>true))
)));
完整代码 -
$filter = array('$and'=> array(
array('code' => (string)$data[0]),
array('common_apps' => array($v_app => array('$exists'=>true))
)));
$options = array();
$query = new MongoDB\Driver\Query($filter, $options);
$cursor = $m->executeQuery("$dbname.$collection_name", $query);
Mongo集合如下 -
{ “_id”:“5ae1bcb793c22d7edf76aed3”, “代码”:“30”, “common_apps”:[ { “com_jio_jioplay_tv”:2 }] } { “_id”:“5ae1bcb793c22d7edf76aed7”, “代码”:“30” }