| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [2017-01-28 12:37 UTC] cmb@php.net
 
-Package: Documentation problem
+Package: mongo
  [2021-08-03 11:40 UTC] cmb@php.net
 
-Status:      Open
+Status:      Closed
-Assigned To:
+Assigned To: cmb
  [2021-08-03 11:40 UTC] cmb@php.net
  | 
    |||||||||||||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 15:00:01 2025 UTC | 
Description: ------------ The MongoCollection::batchInsert method raises a MongoDuplicateKeyException even while using the continueOnError flag. This affects the example because there is no try catch construct. In the test script form I show a simple correction. Test script: --------------- $con = new MongoClient; // rest of the code $c = $db->selectCollection('c'); try { $c->batchInsert( array($doc1, $doc2, $doc3, $doc4), array('continueOnError' => true) ); } catch(MongoDuplicateKeyException $e) { }