MongoDB Documentation, Release 3.0.4 • DBRefs (page 173) are references from one document to another using the value of the first document’s _id field, collection name, and, optionally, its database name. By including these names, DBRefs allow documents located in multiple collections to be more easily linked with documents from a single collection. To resolve DBRefs, your application must perform additional queries to return the referenced documents. Many drivers have helper methods that form the query for the DBRef automatically. The drivers 16 do not auto- matically resolve DBRefs into documents. DBRefs provide a common format and type to represent relationships among documents. The DBRef format also provides common semantics for representing links between documents if your database must interact with multiple frameworks and tools. Unless you have a compelling reason to use DBRefs, use manual references instead. Using manual references is the practice of including one document’s _id field in another document. The application can then issue a second query to resolve the referenced fields as needed. Consider the following operation to insert two documents, using the _id field of the first document as a reference in the second document: Then, when a query returns the document from the people collection you can, if needed, make a second query for the document referenced by the places_id field in the places collection. For nearly every case where you want to store a relationship between two documents, use manual references (page 172). The references are simple to create and your application can resolve references as needed. The only limitation of manual linking is that these references do not convey the database and collection names. If you have documents in a single collection that relate to documents in more than one collection, you may need to consider using DBRefs. Use 16 Some community supported drivers may have alternate behavior and may resolve a DBRef into a document automatically. Chapter 4. Data Models 172 original_id = ObjectId() db.places.insert({ "_id": original_id, "name": "Broadway Center", "url": "bc.example.net" }) db.people.insert({ "name": "Erin", "places_id": original_id, "url": "bc.example.net/Erin" }) Manual References Background Process