From 3cd7c2516a79696d05c92ca063b367bc4ae237ff Mon Sep 17 00:00:00 2001 From: maganap Date: Wed, 15 Mar 2017 11:10:54 +0100 Subject: [PATCH] Corrected ordered duplicate key thrown exception The thrown exception did not match what is explained in the text above and below it. It was showing an error while inserting the first document (_id:13), but actually the error is thrown while inserting the second document (_id:13 again). So, "op" and "nInserted" were corrected, as well as the database and collection names in the "errmsg" to be consistent with the other examples in the same documentation. --- source/reference/method/db.collection.insertMany.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/reference/method/db.collection.insertMany.txt b/source/reference/method/db.collection.insertMany.txt index a55b114c9e1..055e4b2c253 100644 --- a/source/reference/method/db.collection.insertMany.txt +++ b/source/reference/method/db.collection.insertMany.txt @@ -203,18 +203,18 @@ Since ``_id: 13`` already exists, the following exception is thrown: BulkWriteError({ "writeErrors" : [ { - "index" : 0, + "index" : 1, "code" : 11000, - "errmsg" : "E11000 duplicate key error collection: restaurant.test index: _id_ dup key: { : 13.0 }", + "errmsg" : "E11000 duplicate key error collection: inventory.products.$_id_ dup key: { : 13.0 }", "op" : { "_id" : 13, - "item" : "envelopes", - "qty" : 60 + "item" : "stamps", + "qty" : 110 } } ], "writeConcernErrors" : [ ], - "nInserted" : 0, + "nInserted" : 1, "nUpserted" : 0, "nMatched" : 0, "nModified" : 0,