For AI agents: a documentation index is available at https://www.mongodb.com/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.
See how MongoDB 9.0 delivers up to 2x higher throughput.
MongoDB Branding Shape
Register now >
Docs Menu

Document Relationships

MongoDB's flexible data model gives you multiple options to map relationships between different entities in your schema.

Generally, your choice of data model depends on whether you want to embed related data in the same collection or use references to connect related data that exists in separate collections. Before you choose a relationship pattern, review Link Related Data to understand the advantages of each approach.

These pages show examples of different data relationships and how to apply them in a MongoDB schema:

Rate this page

On this page