2

I've read quite some docs now (and also found the question here, but it is still unclear what a document is.

Take the following example:

"users": [
    {
        name: { first: "Alan", last: "Turing" },
        contact: { phone: { type: "cell", number: "111-222-3333" } }
    },
    {
        name: { first: "John", last: "Doe" },
        contact: { phone: { type: "cell", number: "111-222-3333" } }
    }
]

My current assumption is that

{
    name: { first: "Alan", last: "Turing" },
    contact: { phone: { type: "cell", number: "111-222-3333" } }
}

is one document. So the 16MB limit applies to this whole array element. So whatever is in this document, like phone and name, are only embedded documents and therefore do not have this 16MB limit on their own.

Is this correct?

Stephan
  • 1,791
  • 1
  • 27
  • 51

1 Answers1

0

An every single document has a 16 MB size restriction, basically the document is an each data set / a record wrapped inside a "{ }" and which is immediate child of a collection (not nested / embedded document) is a single document, each such a document has a 16 MB of size limit because it is loaded in the memory to read / write data as a single complete record (like row in a relational DB)

Mongo DB has restriction on its document size maximum 16 MB so it should not take more memory inside RAM to represent in BSON format for its efficient memory management

Nitin Dhomse
  • 2,524
  • 1
  • 12
  • 24