獲取多個文件 - 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);
}