In MongoDB, documents stored in a collection require a unique
_id field that acts as a primary key. If an
_id does not exist in the document, MongoDB will create an
ObjectID field. Generally,
_id can itself be a complex document, any BSON data type (still, it must be unique).
ObjectID() is described Here.
As MongoDB internally to store documents in BSON format. BSON extends the JSON model to provide additional data types and to be efficient for encoding and decoding within different languages. MongoDB BSON implementation supports embedding objects and arrays within other objects and arrays – MongoDB can even reach inside BSON objects to build indexes and match objects against query expressions on both top-level and nested BSON keys.
As MongoDB documented Here Data in MongoDB has a flexible schema. Collections do not enforce document structure. Decisions that affect how you model data can affect application performance and database capacity.
This document describes a data model that uses embedded documents to describe relationships between connected data.