note 111152 added to mongocollection.remove

From: Date: Mon, 21 Jan 2013 03:17:25 +0000
Subject: note 111152 added to mongocollection.remove
Groups: php.notes 
Request: Send a blank email to php-notes+get-193284@lists.php.net to get a copy of this message
If you try to remove a document that doesn't exist, remove() won't throw an exception. Even if 'w' is set to 1, remove() will return an array similar to this: Array ( [n] => 0 [connectionId] => 10726 [err] => [ok] => 1 ) So, in order to see if a remove() was really successful, you need to look at [n] key. If it's 0, that means the remove() did not remove any documents. If remove() is successful, [n] will be > 0. ---- Server IP: 69.147.83.199 Probable Submitter: 108.14.236.18 ---- Manual Page -- http://php.net/manual/en/mongocollection.remove.php Edit -- https://master.php.net/note/edit/111152 Del: integrated -- https://master.php.net/note/delete/111152/integrated Del: useless -- https://master.php.net/note/delete/111152/useless Del: bad code -- https://master.php.net/note/delete/111152/bad+code Del: spam -- https://master.php.net/note/delete/111152/spam Del: non-english -- https://master.php.net/note/delete/111152/non-english Del: in docs -- https://master.php.net/note/delete/111152/in+docs Del: other reasons-- https://master.php.net/note/delete/111152 Reject -- https://master.php.net/note/reject/111152 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#193284) next »