获取多个文档 - find()
搜索名为 Mike
的多个用户的示例:
$filter = ['name' => 'Mike'];
$query = new \MongoDB\Driver\Query($filter);
$cursor = $manager->executeQuery('database_name.collection_name', $query);
foreach ($cursor as $doc) {
var_dump($doc);
}
搜索名为 Mike
的多个用户的示例:
$filter = ['name' => 'Mike'];
$query = new \MongoDB\Driver\Query($filter);
$cursor = $manager->executeQuery('database_name.collection_name', $query);
foreach ($cursor as $doc) {
var_dump($doc);
}