|
You can definitely get both:
MongoDB Enterprise repl0:PRIMARY> db.test.insert({_id: 1})
|
MongoDB Enterprise repl0:PRIMARY> db.test.insertMany([{_id : 1}, {_id: 2}], {ordered: false, writeConcern: {w : 2, wtimeout: 1}} )
|
2018-05-01T17:34:29.538-0400 E QUERY [thread1] BulkWriteError: write error at item 0 and problem enforcing write concern in bulk operation :
|
BulkWriteError({
|
"writeErrors" : [
|
{
|
"index" : 0,
|
"code" : 11000,
|
"errmsg" : "E11000 duplicate key error collection: test.test index: _id_ dup key: { : 1.0 }",
|
"op" : {
|
"_id" : 1
|
}
|
}
|
],
|
"writeConcernErrors" : [
|
{
|
"code" : 64,
|
"codeName" : "WriteConcernFailed",
|
"errmsg" : "waiting for replication timed out",
|
"errInfo" : {
|
"wtimeout" : true
|
}
|
}
|
],
|
"nInserted" : 1,
|
"nUpserted" : 0,
|
"nMatched" : 0,
|
"nModified" : 0,
|
"nRemoved" : 0,
|
"upserted" : [ ]
|
})
|
|