From 6133457550b4cb6199805e16379fa86882c91c36 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Thu, 11 Sep 2014 11:50:19 +0000 Subject: [PATCH] Changed example to be non-destructive. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@334840 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/mongo/mongodb/listcollections.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/reference/mongo/mongodb/listcollections.xml b/reference/mongo/mongodb/listcollections.xml index 061d335baa..d2b460d9c8 100644 --- a/reference/mongo/mongodb/listcollections.xml +++ b/reference/mongo/mongodb/listcollections.xml @@ -68,20 +68,19 @@ <function>MongoDB::listCollections</function> example - The following example demonstrates dropping each collection in a database. + The following example demonstrates running count on each collection in a database. selectDB("sample"); +$db = $m->selectDB("demo"); $list = $db->listCollections(); foreach ($list as $collection) { - echo "removing $collection... "; - $collection->drop(); - echo "gone\n"; + echo "amount of documents in $collection: "; + echo $collection->count(), "\n"; } ?> @@ -90,9 +89,10 @@ foreach ($list as $collection) { &example.outputs.similar;