TheBulkWriteandBulkWriteAsyncmethods take a variable number ofWriteModel<>instances and send them to the server in the fewest possible number of batches. The size of a batch is limited by the maximum document size and each batch must consist of the same kind of write operations (i.e. deletes, inserts or updates).
Does that mean that BulkWrite methods should not send batches bigger than 16Mb or that is beyond driver control and should be managed / limited by external methods?
Hi Alex,
The 16MB limit is the maximum size of the current BSON document spec that could be sent over the wire.
The drivers would have taken this into account when communicating to the server, so you don’t have to do a count on the client side. The batch operations will be managed based on the the 16MB document size or the batch size limit. For MongoDB C# driver, see also SizeLimitingBatchableSourceSerializer.cs.
See also Bulk() for more information.
Regards,
Wan.