doc.save() throw duplicate error after insertMany, if doc is from error.insertedDocs in ordered:false insertMany #9677
Labels
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
Milestone
doc.save() throw duplicate error after insertMany error
insertMany(items,{ordered:false})
if doc is from error.insertedDocsMongoError: E11000 duplicate key error collection: sharednews.news index: id dup key: { : ObjectId('5fcf184a7ad701402cdb49c7') }
at Function.create (/node_modules/mongodb/lib/core/error.js:57:12)
at toError (/node_modules/mongodb/lib/utils.js:123:22)
at /node_modules/mongodb/lib/operations/common_functions.js:265:39
at handler (/node_modules/mongodb/lib/core/sdam/topology.js:942:24)
at /node_modules/mongodb/lib/cmap/connection_pool.js:350:13
at handleOperationResult (/node_modules/mongodb/lib/core/sdam/server.js:558:5)
at MessageStream.messageHandler (/node_modules/mongodb/lib/cmap/connection.js:277:5)
at MessageStream.emit (events.js:310:20)
at processIncomingData (/node_modules/mongodb/lib/cmap/message_stream.js:144:12)
at MessageStream._write (/node_modules/mongodb/lib/cmap/message_stream.js:42:5)
at doWrite (_stream_writable.js:403:12)
at writeOrBuffer (_stream_writable.js:387:5)
at MessageStream.Writable.write (_stream_writable.js:318:11)
at Socket.ondata (_stream_readable.js:695:22)
at Socket.emit (events.js:310:20)
at addChunk (_stream_readable.js:286:12) {
driver: true,
index: 0,
code: 11000
}
Do you want to request a feature or report a bug?
What is the current behavior?
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
The text was updated successfully, but these errors were encountered: