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

search for in the

MongoDB::prevError> <MongoDB::lastError
Last updated: Fri, 30 Oct 2009

view this page in

MongoDB::listCollections

(PECL mongo >=0.9.0)

MongoDB::listCollectionsGet a list of collections in this database

Beschreibung

public array MongoDB::listCollections ( void )

Parameter-Liste

Diese Funktion hat keine Parameter.

Rückgabewerte

Returns a list of MongoCollections.

Beispiele

Beispiel #1 MongoDB::listCollections() example

The following example demonstrates dropping each collection in a database.

<?php

$m 
= new Mongo();
$db $m->selectDB("sample");

$list $db->listCollections();
foreach (
$list as $collection) {
    echo 
"removing $collection... ";
    
$collection->drop();
    echo 
"gone\n";
}

?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

removing sample.blog.posts... gone
removing sample.critical.docs... gone
removing sample.taxes... gone
...


add a note add a note User Contributed Notes
MongoDB::listCollections
There are no user contributed notes for this page.

MongoDB::prevError> <MongoDB::lastError
Last updated: Fri, 30 Oct 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites