(PECL mongo >=1.3.0)
MongoDB::getCollectionNames — Get all collections from this database
$includeSystemCollections
= false
] )Returns an array of all the collection names for the given database.
includeSystemCollections
Include system collections.
Returns the names of the all the collections in the database as an array.
Przykład #1 MongoDB::getCollectionNames() example
<?php
$m = new Mongo;
$collections = $m->selectDB("demo")->getCollectionNames());'
var_dump($collections);
Powyższy przykład wyświetli coś podobnego do:
array(2) { [0]=> string(9) "addresses" [1]=> string(5) "users" }