Docs Menu
Docs Home
/ / /
PHP Library Manual
/ / /

MongoDB\Model\CollectionInfo::getInfo()

On this page

  • Definition
  • Return Values
  • Examples
  • See Also

New in version 1.9.

MongoDB\Model\CollectionInfo::getInfo()

Returns additional information about the collection.

function getInfo(): array

An array containing extra information about the collection. This corresponds to the info field returned in the listCollections command reply.

<?php
$info = new CollectionInfo([
'type' => 'view',
'name' => 'foo',
'info' => ['readOnly' => true]
]);
var_dump($info->getInfo());

The output would then resemble:

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

  • listCollections command reference in the MongoDB manual

Back

getIdIndex()