Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mongodb array field size limit

Tags:

mongodb

Which is the limit of a mongodb array field?

subdocuments have a limit of 4mb-16mb(it depends of the version). Does an array has the same limits?

like image 675
leojg Avatar asked Jun 17 '13 18:06

leojg


People also ask

What is the maximum size of MongoDB?

The maximum BSON document size is 16 megabytes. The maximum document size helps ensure that a single document cannot use excessive amount of RAM or, during transmission, excessive amount of bandwidth. To store documents larger than the maximum size, MongoDB provides the GridFS API.

Can MongoDB handle millions of records?

Working with MongoDB and ElasticSearch is an accurate decision to process millions of records in real-time. These structures and concepts could be applied to larger datasets and will work extremely well too.

Can you have an array of objects in MongoDB?

In MongoDB's document model, a 1:N relationship data can be stored within a collection; this is a de-normalized form of data. The related data is stored together and can be accessed (and updated) together. The comments are stored as an array; an array of comment objects.

Can we store array in MongoDB?

One of the benefits of MongoDB's rich schema model is the ability to store arrays as document field values. Storing arrays as field values allows you to model one-to-many or many-to-many relationships in a single document, instead of across separate collections as you might in a relational database.


1 Answers

The only limit is the document size. Whatever Document (or ReferenceDocument) contains the array cannot exceed that size. See limits.

like image 124
mattexx Avatar answered Oct 12 '22 01:10

mattexx