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::getInfo()

Novidades na versão 1.9.

MongoDB\Model\CollectionInfo::getInfo()

Retorna informações adicionais sobre a collection.

function getInfo(): array

Uma matriz contendo informações adicionais sobre a collection. Corresponde ao campo info retornado na resposta do comando listCollections .

<?php
$db = (new MongoDB\Client)->test;
// Creates a view with the readOnly option set to "true"
$db->createCollection(
'myView',
['viewOn' => 'myCollection'],
['readOnly' => true]
);
// Retrieves information about the collection view
foreach ($db->listCollections(['filter' => ['name' => 'myView']]) as $info) {
var_dump($info->getInfo());
}

A saída seria então semelhante a:

array(1) {
["readOnly"]=>
bool(true)
}
  • MongoDB\Database::createCollection()

  • referência do comando listCollections no manual do MongoDB

Voltar

getIdIndex()

Nesta página