[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-doc-cvs
Subject:    [DOC-CVS] =?utf-8?q?svn:_/phpdoc/en/trunk/reference/mongo/_tutorial.xml?=
From:       Derick_Rethans <derick () php ! net>
Date:       2012-11-29 16:20:34
Message-ID: svn-derick-1354206034-328572-1488242277 () svn ! php ! net
[Download RAW message or body]

derick                                   Thu, 29 Nov 2012 16:20:34 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=328572

Log:
Bug #63333: %s/$obj/$document

Bug: https://bugs.php.net/63333 (Open) PHP should return documents as objects, not arrays.
      
Changed paths:
    U   phpdoc/en/trunk/reference/mongo/tutorial.xml

Modified: phpdoc/en/trunk/reference/mongo/tutorial.xml
===================================================================
--- phpdoc/en/trunk/reference/mongo/tutorial.xml	2012-11-29 14:01:18 UTC (rev 328571)
+++ phpdoc/en/trunk/reference/mongo/tutorial.xml	2012-11-29 16:20:34 UTC (rev 328572)
@@ -25,19 +25,19 @@
 $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 @@
 $connection = new MongoClient();
 $collection = $connection->database->collectionName;

-$obj = $collection->findOne();
-var_dump( $obj );
+$document = $collection->findOne();
+var_dump( $document );
 ?>
 ]]>
     </programlisting>



-- 
PHP Documentation Commits Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic