note 103798 added to mongocollection.update
| From: | eeroateerodotinfo at osu1 dot php dot net | Date: | Wed, 04 May 2011 11:08:09 +0000 |
| Subject: | note 103798 added to mongocollection.update | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-179401@lists.php.net to get a copy of this message | ||
Quote from http://www.mongodb.org/display/DOCS/Updating
Checking the Outcome of an Update Request
As described above, a non-upsert update may or may not modify an existing object. An upsert will
either modify an existing object or insert a new object. The client may determine if its most recent
message on a connection updated an existing object by subsequently issuing a getlasterror command (
db.runCommand( "getlasterror" ) ). If the result of the getlasterror command contains an
updatedExisting field, the last message on the connection was an update request.
**If the updatedExisting field's value is true, that update request caused an existing object
to be updated; if updatedExisting is false, no existing object was updated.**
An "upserted" field will contain the new _id value if an insert is performed (new as of
1.5.4).
So, if you execute update(), and returned array's updateExisting key's value is false,
object was not updated.
----
Server IP: 69.147.83.197
Probable Submitter: 83.145.215.158
----
Manual Page -- http://www.php.net/manual/en/mongocollection.update.php
Edit -- https://master.php.net/note/edit/103798
Del: integrated -- https://master.php.net/note/delete/103798/integrated
Del: useless -- https://master.php.net/note/delete/103798/useless
Del: bad code -- https://master.php.net/note/delete/103798/bad+code
Del: spam -- https://master.php.net/note/delete/103798/spam
Del: non-english -- https://master.php.net/note/delete/103798/non-english
Del: in docs -- https://master.php.net/note/delete/103798/in+docs
Del: other reasons-- https://master.php.net/note/delete/103798
Reject -- https://master.php.net/note/reject/103798
Search -- https://master.php.net/manage/user-notes.php