-
Type: New Feature
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Usability
-
None
The isMaster command result contains two fields related to size:
- maxBsonObjectSize: the maximum size of a document that will be stored in a mongo collection.
- maxMessageSizeBytes: the maximum size of a wire protocol message
This is a request for a third:
- maxBsonWireObjectSize: the maximum size of a document not intended for storage that is included in a wire protocol message.
The reason this is necessary is that current drivers will not correctly send a command that includes a document that is close to the 16MB limit, because drivers apply maxBsonObjectSize to all documents, including command documents. Ao for example, most drivers will reject a findAndModify that contains a 16MB replacement document. With the new write commands, they will reject an insert of a 16MB document.
Looking at the server code, the current value of maxBsonWireObjectSize is 16MB + 16K:
mongo/bson/util/builder.h: const int BSONObjMaxInternalSize = BSONObjMaxUserSize + ( 16 * 1024 )
Drivers can use this new field to impose a different limit on command documents than they impose on documents intended for storage. Without, they will have to hardcode the value in a constant, which is less than ideal, as it may change in the future.
- is related to
-
SERVER-12275 Add MaxWriteBatchSize to isMaster results.
- Closed
- related to
-
CDRIVER-3310 OP_QUERY bulk write should not batch documents exceeding size of maxBsonObjectSize
- Backlog