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

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@328572 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Derick Rethans 2012-11-29 16:20:34 +00:00
parent 95613c0697
commit df8a0aceef

View file

@ -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 );
?>
]]>
</programlisting>