Novidades na versão 1.9.
Definição
Return Values
O tipo de collection. Corresponde ao campo type
retornado na resposta do comando listCollections
.
Exemplos
$db = (new MongoDB\Client)->test; $db->createCollection('myCollection'); // Retrieves the collection type foreach ($db->listCollections(['filter' => ['name' => 'myCollection']]) as $info) { echo $info->getType(); }
A saída seria então semelhante a:
collection
Veja também
referência do comando listCollections no manual do MongoDB