-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: None
-
None
-
Empty show more show less
reproduction code:
const MongoClient = require('mongodb').MongoClient; MongoClient.connect('mongodb://localhost', (err, db) => { let test = db.collection('test'); return test.insert([{a: 1}, {a: 1}, {a: 1}, {a: 1}, {a: 1}, {a: 1}]) .then(result => console.log(result.insertedIds.length)) .then(() => db.close()); });
This is the same as a call to `test.insertMany(<data>,
{ ordered: false }`, which also returns 7 inserted ids due to the fact that the internal representation of the ids is 1-indexed (rather than starting at 0).