Skip to content

Commit 7548864

Browse files
authored
(DOCSP-32333) Revamps database reference page to include Atlas UI steps (#4842) (#4902)
* (DOCSP-32333) Revamps database reference page to include Atlas UI steps * Includes changes from copy review * Fixes copy review issues
1 parent 36b7b4b commit 7548864

File tree

1 file changed

+75
-3
lines changed

1 file changed

+75
-3
lines changed

source/reference/database-references.txt

Lines changed: 75 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Database References
99
.. contents:: On this page
1010
:local:
1111
:backlinks: none
12-
:depth: 1
12+
:depth: 2
1313
:class: singlecol
1414

1515
For many use cases in MongoDB, the denormalized data model where
@@ -29,6 +29,11 @@ or databases.
2929
This page outlines alternative procedures that predate the
3030
:pipeline:`$lookup` and :pipeline:`$graphLookup` pipeline stages.
3131

32+
You can create a database reference for deployments hosted in the
33+
following environments:
34+
35+
.. include:: /includes/fact-environments.rst
36+
3237
MongoDB applications use one of two methods to relate documents:
3338

3439
- :ref:`Manual references <document-references>` save the
@@ -69,8 +74,75 @@ A manual reference is the practice of including one
6974
application can then issue a second query to resolve the referenced
7075
fields as needed.
7176

72-
Process
73-
~~~~~~~
77+
Create a Manual Reference in the {+atlas+} UI
78+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
79+
80+
To create a manual reference in the {+atlas+} UI, follow these steps:
81+
82+
.. procedure::
83+
:style: normal
84+
85+
.. step:: Navigate to the collection.
86+
87+
a. In the {+atlas+} UI, click :guilabel:`Database` in the sidebar.
88+
#. For the database deployment where you want to add a database
89+
reference, click :guilabel:`Browse Collections`.
90+
#. In the left navigation pane, select the database.
91+
#. In the left navigation pane, select the collection. This
92+
example references a ``places`` collection.
93+
94+
.. step:: Add a document.
95+
96+
a. Click :guilabel:`Insert Document`.
97+
#. Click the JSON view icon (:guilabel:`{{}}`).
98+
#. Paste the following data into the document:
99+
100+
.. code-block::
101+
102+
{
103+
"_id": {
104+
"$oid": "651aea5870299b120736f442"
105+
},
106+
"name": "Broadway Center",
107+
"url": "bc.example.net"
108+
}
109+
110+
#. Click :guilabel:`Insert`.
111+
112+
.. step:: Add a document in the ``people`` collection that references the entry in ``places``.
113+
114+
a. In the left navigation pane, select a different
115+
collection. This example references a ``people`` collection.
116+
#. Click :guilabel:`Insert Document`.
117+
#. Click the JSON view icon (:guilabel:`{{}}`).
118+
#. Paste the following data into the document:
119+
120+
.. code-block::
121+
122+
{
123+
"_id": {
124+
"$oid": "651aebeb70299b120736f443"
125+
},
126+
"name": "Erin",
127+
"places_id": "651aea5870299b120736f442"
128+
"url": "bc.example.net/Erin"
129+
}
130+
131+
#. Click :guilabel:`Insert`.
132+
133+
When a query returns the document from the ``people``
134+
collection you can, if needed, filter the query results from
135+
the ``places`` collection for the document referenced by the
136+
``places_id`` field.
137+
138+
To learn more about running queries in {+atlas+},
139+
see :atlas:`View, Filter, and Sort Documents
140+
</atlas-ui/documents/#view--filter--and-sort-documents>` in
141+
the {+atlas+} documentation.
142+
143+
144+
Create a Manual Reference in the Terminal
145+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
74146

75147
Consider the following operation to insert two documents, using the
76148
``_id`` field of the first document as a reference in the second

0 commit comments

Comments
 (0)