PHP Using MongoDB Get multiple documents - find()


Example

Example for searching multiple users with the name "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);
}