From df8a0aceefb60b5b66da4a6ffa030419767ec339 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Thu, 29 Nov 2012 16:20:34 +0000 Subject: [PATCH] Bug #63333: %s/$obj/$document git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@328572 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/mongo/tutorial.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/reference/mongo/tutorial.xml b/reference/mongo/tutorial.xml index d4e07cbc3b..14e779cc94 100644 --- a/reference/mongo/tutorial.xml +++ b/reference/mongo/tutorial.xml @@ -25,19 +25,19 @@ $db = $m->comedy; $collection = $db->cartoons; // add a record -$obj = array( "title" => "Calvin and Hobbes", "author" => "Bill Watterson" ); -$collection->insert($obj); +$document = array( "title" => "Calvin and Hobbes", "author" => "Bill Watterson" ); +$collection->insert($document); // add another record, with a different "shape" -$obj = array( "title" => "XKCD", "online" => true ); -$collection->insert($obj); +$document = array( "title" => "XKCD", "online" => true ); +$collection->insert($document); // find everything in the collection $cursor = $collection->find(); // iterate through the results -foreach ($cursor as $obj) { - echo $obj["title"] . "\n"; +foreach ($cursor as $document) { + echo $document["title"] . "\n"; } ?> @@ -241,8 +241,8 @@ $collection->insert( $doc ); $connection = new MongoClient(); $collection = $connection->database->collectionName; -$obj = $collection->findOne(); -var_dump( $obj ); +$document = $collection->findOne(); +var_dump( $document ); ?> ]]>