Model One-to-Many Relationships with Embedded Documents (page 153) Presents a data model that uses embedded documents (page 146) to describe one-to-many relationships between connected data. 

Model One-to-Many Relationships with Document References (page 154) Presents a data model that uses references (page 147) to describe one-to-many relationships between documents. 

Model Tree Structures (page 156) Examples for modeling tree structures. 

Model Tree Structures with Parent References (page 157) Presents a data model that organizes documents in a tree-like structure by storing references (page 147) to “parent” nodes in “child” nodes. 

Model Tree Structures with Child References (page 158) Presents a data model that organizes documents in a tree-like structure by storing references (page 147) to “child” nodes in “parent” nodes. 

See Model Tree Structures (page 156) for additional examples of data models for tree structures. 

Model Specific Application Contexts (page 164) Examples for models for specific application contexts. 

Model Data for Atomic Operations (page 164) Illustrates how embedding fields related to an atomic update within the same document ensures that the fields are in sync. 

Model Data to Support Keyword Search (page 165) Describes one method for supporting keyword search by storing keywords in an array in the same document as the text field. Combined with a multi-key index, this pattern can support application’s keyword search operations. 

## 4.3.1 Model Relationships Between Documents 

Model One-to-One Relationships with Embedded Documents (page 152) Presents a data model that uses embedded documents (page 146) to describe one-to-one relationships between connected data. 

Model One-to-Many Relationships with Embedded Documents (page 153) Presents a data model that uses embed- ded documents (page 146) to describe one-to-many relationships between connected data. 

Model One-to-Many Relationships with Document References (page 154) Presents a data model that uses refer- ences (page 147) to describe one-to-many relationships between documents. 

## Model One-to-One Relationships with Embedded Documents 

## Overview 

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. See Data Modeling Concepts (page 145) for a full high level overview of data modeling in MongoDB. 

This document describes a data model that uses embedded (page 146) documents to describe relationships between connected data. 

## Pattern 

Consider the following example that maps patron and address relationships. The example illustrates the advantage of embedding over referencing if you need to view one data entity in context of the other. In this one-to-one relationship between patron and address data, the address belongs to the patron . 

In the normalized data model, the address document contains a reference to the patron document. 

