Doc #67964 [Opn->Csd]: MongoCollection::batchInsert error in example
| From: | cmb@php.net | Date: | Tue, 03 Aug 2021 11:40:59 +0000 |
| Subject: | Doc #67964 [Opn->Csd]: MongoCollection::batchInsert error in example | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-19021@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=67964&edit=1
ID: 67964
Updated by: cmb@php.net
Reported by: pau at rullan dot cat
Summary: MongoCollection::batchInsert error in example
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: mongo
PHP Version: Irrelevant
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
The documentation of the mongo package has been removed from the
manual, because the mongo package is superseeded by the mongodb
package for years. This ticket is obsolete.
Previous Comments:
------------------------------------------------------------------------
[2014-09-05 09:50:11] pau at rullan dot cat
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) {
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67964&edit=1