monkeyUser
monkeyUser

Reputation: 4671

How many documents can a single collection have in MongoDB?

I haven't found any information about this.

How many documents can a single collection have in MongoDB before it is necessary to use sharding?

Upvotes: 19

Views: 10793

Answers (2)

M-A. Fernandes
M-A. Fernandes

Reputation: 550

There is no limitation as you can see here:

If you specify a maximum number of documents for a capped collection using the max parameter to create, the limit must be less than 2^32 documents. If you do not specify a maximum number of documents when creating a capped collection, there is no limit on the number of documents.

Upvotes: 17

simhumileco
simhumileco

Reputation: 34535

@M-A.Fernandes has right.

I can only add this information:

Maximum Number of Documents Per Chunk to Migrate

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

Upvotes: 5

Related Questions