(PECL mongo >=1.6.0)
MongoDB::getCollectionInfo — Returns information about indexes on this collection
$includeSystemCollections
= false
] )Gets a list of all the collections in the database and returns them as an array of documents containing their names and options.
includeSystemCollections
Include system collections.
This function returns an array in which each element describes a collection. Elements will contain the values name for the name of the collection, and optionally an options array to indicate options for a specific collection. Options are things like whether a collection is capped for example.
Example #1 MongoDB::getCollectionInfo() example
<?php
$c = new MongoClient;
$d = $c->test;
$collections = $d->getCollectionInfo();
var_dump($collections);
?>
Il precedente esempio visualizzerĂ qualcosa simile a:
array(2) { 'book' => array(1) { 'name' => string(9) "test.book" } 'texttest' => array(2) { 'name' => string(13) "test.texttest" 'options' => array(1) { 'flags' => int(1) } } }