The MongoDB collection does not enforce structure on the document. This allows the document to map to objects or entities easily. Each document can match a data field of the entity. In practice, documents in collections share the same structure.
When deciding on data modeling, we have to consider the requirements of the application, the performance characteristics of the database's design, and data retrieval patterns. When designing data models, we have to focus on the application's usage of data and the inherent structure of the data.
While deciding the data model, we have to consider the structure of the document and how documents relate to each other. There are two key data models that show these relationships:
- The reference document data model
- The embedded data model