According to MongoDB documentation:
Bulk Operation Size
A bulk operation can have at most 1000 operations.
However, I was able to use bulk with much larger operations count (around 300k operations) using Mongo 2.6 bulk operations API with node-mongodb-native (collection.initializeUnorderedBulkOp()
etc.)
Is this limit outdated, or am I just missing something? Do you know what is the real limit?
It is however very inefficient to retrieve documents one at a time from the server. Batch size is how many documents the driver requests from the server at once.
The maximum size an individual document can be in MongoDB is 16MB with a nested depth of 100 levels. Edit: There is no max size for an individual MongoDB database.
MongoDB provides clients the ability to perform write operations in bulk. Bulk write operations affect a single collection. MongoDB allows applications to determine the acceptable level of acknowledgement required for bulk write operations.
Multiple documents can be inserted at a time in MongoDB using bulk insert operation where an array of documents is passed to the insert method as parameter.
I opened a ticket in MongoDB's Jira. They replied that:
You're correct; this limit needs some clarification in the documentation. The limit is on the server, but client drivers hide the limit from application developers by splitting bulk operations into multiple batches.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With