@@ -24,19 +24,28 @@ MongoDB applications use one of two methods for relating documents:
24
24
cases.
25
25
26
26
#. :ref:`DBRefs <dbref>` are references from one document to another
27
- using its _id field value, and collection, and (possibly) a database name, for the target
28
- document. Resolving DBRefs requires queries from your
29
- application; however, many :doc:`drivers </applications/drivers>`
30
- have helper methods to resolve DBRefs without having to form the query manually.
31
- No official driver automatically resolves DBRefs to documents for you; some frameworks and toolkits
32
- provide automatically linking and (link) resolution if you wish to use these features.
33
- DBRefs are useful when you need to embed documents from multiple collections in documents from one
34
- collection. They also provide a common format and type for tools which can represent the link semantics provided
35
- in your documents, or for interactions between frameworks which store linked documents.
27
+ using the value of the first documents ``_id`` field collection,
28
+ and optionally database name. To resolve DBRefs, your application
29
+ must perform additional queries to return the referenced
30
+ documents. Many :doc:`drivers </applications/drivers>` have helper
31
+ methods that form the query for the DBRef automatically. The
32
+ drivers [#offical-driver]_ do not *automatically* resolve DBRefs
33
+ into documents.
34
+
35
+ Use DBRefs when you need to embed documents from multiple
36
+ collections in documents from one collection. DBRefs also provide a
37
+ common format and type to represent these relationships between
38
+ documents. DBRefs provide common semantics for representing these
39
+ links between documents if your database must interact with
40
+ multiple frameworks and tools.
36
41
37
42
Unless you have a compelling reason for using DBrefs, use manual
38
43
references.
39
44
45
+ .. [#offical-driver] Some community supported drivers may have
46
+ alternate behavior and may resolve DBRefs into documents
47
+ already.
48
+
40
49
.. _document-references:
41
50
42
51
Manual References
@@ -101,7 +110,7 @@ Background
101
110
DBRefs are a convention for representing a :term:`document`, rather
102
111
than a specific reference "type." They include the name of the
103
112
collection, and in some cases the database, in addition to the
104
- value from the _id field.
113
+ value from the `` _id`` field.
105
114
106
115
Format
107
116
~~~~~~
0 commit comments