(PECL mongo >=1.3.0)
MongoDB::getCollectionNames — このデータベースのすべてのコレクションを取得する
$includeSystemCollections = false
] )指定したデータベースのすべてのコレクションの名前を配列で返します。
includeSystemCollections
システムコレクションを含むかどうか。
指定したデータベースのすべてのコレクションの名前を配列で返します。
例1 MongoDB::getCollectionNames() の例
<?php
$m = new Mongo;
$collections = $m->selectDB("demo")->getCollectionNames());'
var_dump($collections);
上の例の出力は、 たとえば以下のようになります。
array(2) {
[0]=>
string(9) "addresses"
[1]=>
string(5) "users"
}