How many documents can one collection have in MongoDB?

I did not find any information about this.

How many documents can one collection have in MongoDB before you need to use sharding?

+9
source share
2 answers

There are no restrictions, as you can see here :

If for creation you specify the maximum number of documents for a closed collection using the max parameter, the restriction should be less than 2 ^ 32 documents. If you do not specify the maximum number of documents when creating a collection with restrictions, the number of documents is not limited.

+6
source

@ MA.Fernandes is entitled.

I can add only this information :

Maximum number of documents per chunk for migration

MongoDB cannot move a chunk if the number of documents in the chunk exceeds 250,000 documents or 1.3 times the result of dividing the configured chunk size by the average document size. db.collection.stats() contains the avgObjSize field, which represents the average size of the document in the collection.

+1
source

Source: https://habr.com/ru/post/1247926/


All Articles