17

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?

simhumileco
  • 31,877
  • 16
  • 137
  • 115
monkeyUser
  • 4,301
  • 7
  • 46
  • 95

2 Answers2

16

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.

simhumileco
  • 31,877
  • 16
  • 137
  • 115
M-A. Fernandes
  • 530
  • 5
  • 13
  • 2
    In contrast with @M-A. Fernandes, there is a limitation. But it is not imposed by MongoDB and it's not a fixed number of documents. It may seems very obvious, but correct: the limitations on collection sizes depends on your system capability. How big a collection can be in a single node? – Héctor Valverde Apr 26 '16 at 14:55
4

@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.

Community
  • 1
  • 1
simhumileco
  • 31,877
  • 16
  • 137
  • 115