note 110746 added to mongocollection.save
| From: | cuisdy at gmail dot com | Date: | Fri, 30 Nov 2012 17:36:20 +0000 |
| Subject: | note 110746 added to mongocollection.save | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-192235@lists.php.net to get a copy of this message | ||
Same as with method insert(), it is worth noting that creating a reference to $obj will have the
same effect as $obj being a reference itself, i.e. no _id field will be added.
<?php
$a = &$obj;
$m = new MongoClient;
$collection = $m->test->phpmanual;
$obj = array('x' => 1);
// Suppose you create a reference for some reason
$a = &$obj;
$collection->save($obj);
var_dump($obj);
// prints: array(1) { ["x"]=> int(1) }
----
Server IP: 69.147.83.199
Probable Submitter: 186.52.24.136
----
Manual Page -- http://www.php.net/manual/en/mongocollection.save.php
Edit -- https://master.php.net/note/edit/110746
Del: integrated -- https://master.php.net/note/delete/110746/integrated
Del: useless -- https://master.php.net/note/delete/110746/useless
Del: bad code -- https://master.php.net/note/delete/110746/bad+code
Del: spam -- https://master.php.net/note/delete/110746/spam
Del: non-english -- https://master.php.net/note/delete/110746/non-english
Del: in docs -- https://master.php.net/note/delete/110746/in+docs
Del: other reasons-- https://master.php.net/note/delete/110746
Reject -- https://master.php.net/note/reject/110746
Search -- https://master.php.net/manage/user-notes.php