The official website has a description of the problem (Using a Large number of collections). By default, the namespace for each database of MongoDB is saved in a 16MB. ns file, with an average of about 628 bytes per name, or about 24000 of the namespace for the entire database.
Each collection and index will occupy a namespace. Therefore, if each collection has an index (such as the default _id index), you can create up to 12,000 collections. If the number of indexes is greater, the number of collections that can be created is even less. Also, if the number of collections is too many, some operations become slower.
However, if you really need to build more collections, MongoDB is also supported, just to start with the "--nssize" parameter, so that the corresponding database namespace file can be larger to save more names. This namespace file (. ns file) can be up to 2G, which means that up to 3.4 million names can be supported, and a maximum of about 1.7 million collections can be created if each collection has an index.
Also note that--nssize only sets the size of the newly created. ns file, and if you want to change the namespace of a database that already exists, you will need to run the db.repairdatabase () command to adjust the size after starting with this parameter.