Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is MongoDB batch operation max size?

Tags:

mongodb

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?

like image 274
Elad Avatar asked Jun 16 '14 06:06

Elad


People also ask

What is batch size in MongoDB?

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.

What is the maximum size of a MongoDB document?

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.

What is bulk operation in MongoDB?

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.

What is batch insert in MongoDB?

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.


1 Answers

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.

like image 135
Elad Avatar answered Oct 11 '22 11:10

Elad