downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

MongoDB::getDBRef> <MongoDB::__get
[edit] Last updated: Fri, 17 May 2013

view this page in

MongoDB::getCollectionNames

(PECL mongo >=1.3.0)

MongoDB::getCollectionNamesGet all collections from this database

Description

public array MongoDB::getCollectionNames ([ bool $includeSystemCollections = false ] )

Returns an array of all the collection names for the given database.

Parameters

includeSystemCollections

Include system collections.

Return Values

Returns the names of the all the collections in the database as an array.

Examples

Example #1 MongoDB::getCollectionNames() example

<?php

$m 
= new Mongo;
$collections $m->selectDB("demo")->getCollectionNames());'
var_dump($collections);

The above example will output something similar to:

array(2) {
  [0]=>
  string(9) "addresses"
  [1]=>
  string(5) "users"
}

See Also



add a note add a note User Contributed Notes MongoDB::getCollectionNames - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites