Doc #67964 [NEW]: MongoCollection::batchInsert error in example

From: Date: Fri, 05 Sep 2014 09:50:12 +0000
Subject: Doc #67964 [NEW]: MongoCollection::batchInsert error in example
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-11461@lists.php.net to get a copy of this message
From: pau at rullan dot cat Operating system: PHP version: Irrelevant Package: Documentation problem Bug Type: Documentation Problem Bug description:MongoCollection::batchInsert error in example 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 bug report at https://bugs.php.net/bug.php?id=67964&edit=1 --

« previous php.doc.bugs (#11461) next »