note 99615 added to mongocollection.ensureindex
| From: | alan dot lake at lakeinfoworks dot com | Date: | Thu, 26 Aug 2010 15:45:31 +0000 |
| Subject: | note 99615 added to mongocollection.ensureindex | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-172097@lists.php.net to get a copy of this message | ||
The statement
<?php
$c->ensureIndex(array('x' => 1), array("unique" => true));
?>
will prevent a document with a duplicate key ('x') from being added to the connection, but
will not throw an exception. To cause an exception to be thrown, use the "safe"=>true
option in the insert statement.
----
Server IP: 62.237.7.3
Probable Submitter: 80.223.125.57
----
Manual Page -- http://www.php.net/manual/en/mongocollection.ensureindex.php
Edit -- https://master.php.net/note/edit/99615
Del: integrated -- https://master.php.net/note/delete/99615/integrated
Del: useless -- https://master.php.net/note/delete/99615/useless
Del: bad code -- https://master.php.net/note/delete/99615/bad+code
Del: spam -- https://master.php.net/note/delete/99615/spam
Del: non-english -- https://master.php.net/note/delete/99615/non-english
Del: in docs -- https://master.php.net/note/delete/99615/in+docs
Del: other reasons-- https://master.php.net/note/delete/99615
Reject -- https://master.php.net/note/reject/99615
Search -- https://master.php.net/manage/user-notes.php