|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #67964 MongoCollection::batchInsert error in example
Submitted: 2014-09-05 09:50 UTC Modified: 2017-01-28 12:37 UTC
Avg. Score:4.3 ± 0.5
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:1 (33.3%)
From: pau at rullan dot cat Assigned:
Status: Open Package: mongo (PECL)
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: pau at rullan dot cat
New email:
PHP Version: OS:


 [2014-09-05 09:50 UTC] pau at rullan dot cat
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 {
    array($doc1, $doc2, $doc3, $doc4),
    array('continueOnError' => true)
} catch(MongoDuplicateKeyException $e) {


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-28 12:37 UTC]
-Package: Documentation problem +Package: mongo
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Apr 11 17:01:27 2021 UTC