Description
Running the code below:
var maxBsonObjectSize = db.isMaster().maxBsonObjectSize;
|
var docOverhead = Object.bsonsize({ _id: new ObjectId(), x: '' });
|
var maxStrSize = maxBsonObjectSize - docOverhead;
|
|
|
var maxStr = 'a';
|
while (maxStr.length < maxStrSize) maxStr += 'a';
|
|
|
var coll = db.max_doc_size;
|
|
|
coll.drop();
|
var id = new ObjectId();
|
coll.insert({ _id: id });
|
assert.writeOK(coll.update({ _id: id }, { $set: { x: maxStr }}));
|
Results in the shell throwing "Cannot output SingleWriteResult from multiple batch result". This appears to be a problem in the splitting logic inside the addToOperationsList method in bulk_api.js.
Attachments
Issue Links
- duplicates
-
SERVER-12977 Write commands should error on empty array of operations
-
- Closed
-
- is related to
-
SERVER-12763 Shell insert method provides confusing error message when inserting many objects.
-
- Closed
-