Join us Sept 17 at .local NYC! Use code WEB50 to save 50% on tickets. Learn more >
MongoDB Event
Menu Docs
Página inicial do Docs
/ / /
Manual da Biblioteca PHP
/ / /

MongoDB\Model\CollectionInfo::getType()

Novidades na versão 1.9.

MongoDB\Model\CollectionInfo::getType()

Retorne o tipo de coleção.

function getType(): string

O tipo de collection. Corresponde ao campo type retornado na resposta do comando listCollections .

<?php
$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
  • MongoDB\Database::createCollection()

  • referência do comando listCollections no manual do MongoDB

Voltar

getOptions()

Nesta página