mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
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:
parent
95613c0697
commit
df8a0aceef
1 changed files with 8 additions and 8 deletions
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue