language: "English" } 

To avoid mutable, growing arrays, store the publisher reference inside the book document: 

{ _id: "oreilly", name: "O'Reilly Media", founded: 1980, location: "CA" } { _id: 123456789, title: "MongoDB: The Definitive Guide", author: [ "Kristina Chodorow", "Mike Dirolf" ], published_date: ISODate("2010-09-24"), pages: 216, language: "English", publisher_id: "oreilly" } { _id: 234567890, title: "50 Tips and Tricks for MongoDB Developer", author: "Kristina Chodorow", published_date: ISODate("2011-05-06"), pages: 68, language: "English", publisher_id: "oreilly" } 

## 4.3.2 Model Tree Structures 

MongoDB allows various ways to use tree data structures to model large hierarchical or nested data relationships. 

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. 

Model Tree Structures with an Array of Ancestors (page 160) Presents a data model that organizes documents in a tree-like structure by storing references (page 147) to “parent” nodes and an array that stores all ancestors. 

Model Tree Structures with Materialized Paths (page 161) Presents a data model that organizes documents in a tree- like structure by storing full relationship paths between documents. In addition to the tree node, each document stores the _id of the nodes ancestors or path as a string. 

Model Tree Structures with Nested Sets (page 163) Presents a data model that organizes documents in a tree-like structure using the Nested Sets pattern. This optimizes discovering subtrees at the expense of tree mutability. 

