|
MongoDB::getCollectionInfoReturns information about collections in this database 説明
public array MongoDB::getCollectionInfo
([ array
$options = array()
] )Gets a list of all collections in the database and returns them as an array of documents, which contain their names and options.
パラメータ
返り値This function returns an array where each element is an array describing a collection. Elements will contain a name key denoting the name of the collection, and optionally contain an options key denoting an array of objects used to create the collection. For example, capped collections will include capped and size options. エラー / 例外For MongoDB 2.6 and earlier, MongoException will be thrown if a non-string value was specified for the "filter" option's "name" criteria. 例例1 MongoDB::getCollectionInfo example
<?php 上の例の出力は、 たとえば以下のようになります。 array(2) { [0]=> array(2) { ["name"]=> string(4) "logs" ["options"]=> array(2) { ["capped"]=> bool(true) ["size"]=> int(10240) } } [1]=> array(2) { ["name"]=> string(5) "users" ["options"]=> array(1) { ["flags"]=> int(1) } } } 参考
|