|
MongoDB::getCollectionInfoReturns information about collections in this database Beschreibung
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.
Parameter-Liste
RückgabewerteThis 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. Fehler/ExceptionsFor MongoDB 2.6 and earlier, MongoException will be thrown if a non-string value was specified for the "filter" option's "name" criteria. BeispieleBeispiel #1 MongoDB::getCollectionInfo example
<?phpDas oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:
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)
}
}
}
Siehe auch
|