# Referencing: Linking Documents by \_id

Referencing links two documents by storing one's \_id in the other, like a customerId in each order, so shared or changing data lives in one place, at the cost of a second query to follow the link.

![Cheat sheet: Referencing: Linking Documents by \_id](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/a2217cea4d6244dba728dddd48ad5a8e.webp)

- Category: MongoDB
- Level: Apprentice
- Tags: \_id and ObjectId, Document Reference, Embedding vs Referencing, mongodb, nosql
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/mongodb-referencing-documents-cheat-sheet
