note 111172 added to mongocollection.insert

From: Date: Tue, 22 Jan 2013 16:53:16 +0000
Subject: note 111172 added to mongocollection.insert
Groups: php.notes 
Request: Send a blank email to php-notes+get-193344@lists.php.net to get a copy of this message
"Note: If the parameter does not have an _id key or property, a new MongoId instance will be created and assigned to it." Note on note: this is true even if the insert *fails* (because of, say, duplicate key error). So even if no new document was inserted, the supplied array will still have a new MongoID key ->_id after the ->insert(). (which can make an attempted update after that fail, because you cannot update the _id value of a document..) ---- Server IP: 83.137.20.135 Probable Submitter: 213.125.170.146 ---- Manual Page -- http://php.net/manual/en/mongocollection.insert.php Edit -- https://master.php.net/note/edit/111172 Del: integrated -- https://master.php.net/note/delete/111172/integrated Del: useless -- https://master.php.net/note/delete/111172/useless Del: bad code -- https://master.php.net/note/delete/111172/bad+code Del: spam -- https://master.php.net/note/delete/111172/spam Del: non-english -- https://master.php.net/note/delete/111172/non-english Del: in docs -- https://master.php.net/note/delete/111172/in+docs Del: other reasons-- https://master.php.net/note/delete/111172 Reject -- https://master.php.net/note/reject/111172 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#193344) next »