Skip to content

Commit ab1773f

Browse files
authored
(DOCSP-32021)(DOCSP-33353) Adds procedure to query embedded docs in Atlas and updates selector instructions (#4821) (#4877)
* (DOCSP-32021)(DOCSP-33353) Adds procedure to query embedded docs in Atlas and updates selector instructions * Adds some includes to use in other PRs * Includes changes from copy and tech review * Includes copy review fix to format
1 parent 2d36389 commit ab1773f

File tree

6 files changed

+68
-20
lines changed

6 files changed

+68
-20
lines changed

source/includes/fact-methods.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- Your programming language's driver.
2+
- The :atlas:`{+atlas+} UI </>`. To learn more, see
3+
|atlas-ref|.
4+
- :compass:`MongoDB Compass </>`.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
----------
2+
3+
.. |arrow| unicode:: U+27A4
4+
5+
|arrow| Use the **Select your language** drop-down menu in the
6+
upper-right to set the language of the following examples or select
7+
MongoDB Compass.
8+
9+
----------
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
a. In the {+atlas+} UI, click :guilabel:`Database` in the sidebar.
2+
#. For the database deployment that contains the sample data,
3+
click :guilabel:`Browse Collections`.
4+
#. In the left navigation pane, select the
5+
:guilabel:`sample_mflix` database.
6+
#. Select the :guilabel:`movies` collection.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Specify the :ref:`query filter document <document-query-filter>`
2+
in the :guilabel:`Filter` field. A query filter document uses
3+
:ref:`query operators <csfle-supported-query-operators>` to specify
4+
search conditions.
5+
6+
Copy the following query filter document into the
7+
:guilabel:`Filter` search bar:

source/tutorial/query-embedded-documents.txt

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ Query on Embedded/Nested Documents
1919
:backlinks: none
2020
:depth: 1
2121

22-
----------
22+
You can query embedded documents in MongoDB by using the following
23+
methods:
2324

24-
.. |arrow| unicode:: U+27A4
25+
.. |atlas-ref| replace:: :ref:`query-embedded-documents-atlas-ui`
2526

26-
|arrow| Use the **Select your language** drop-down menu in the
27-
upper-right to set the language of the following examples.
27+
.. include:: /includes/fact-methods.rst
2828

29-
----------
29+
.. include:: /includes/language-selector-instructions.rst
3030

3131
.. tabs-selector:: drivers
3232

@@ -91,6 +91,39 @@ is less than ``15``, the nested field ``uom`` equals ``"in"``, and the
9191

9292
.. include:: /includes/driver-examples/driver-example-query-19.rst
9393

94+
.. _query-embedded-documents-atlas-ui:
95+
96+
Query Embedded Documents with {+atlas+}
97+
---------------------------------------------------
98+
99+
The example in this section uses the :atlas:`sample movies dataset
100+
</sample-data/sample-mflix/>`. To learn how to load the sample dataset
101+
into your {+atlas+} deployment, see :atlas:`Load Sample Data
102+
</sample-data/#std-label-load-sample-data>`.
103+
104+
To query an embedded document in {+atlas+}, follow these steps:
105+
106+
.. procedure::
107+
:style: normal
108+
109+
.. step:: Navigate to the collection
110+
111+
.. include:: /includes/steps-nav-atlas-sample-movies.rst
112+
113+
.. step:: Specify the query filter document
114+
115+
.. include:: /includes/steps-specify-query-filter.rst
116+
117+
.. code-block:: javascript
118+
119+
{ "awards.wins": 1 }
120+
121+
.. step:: Click :guilabel:`Apply`
122+
123+
This query filter returns all documents in the
124+
``sample_mflix.movies`` collection where the embedded document
125+
for the ``awards`` field contains ``{ wins: 1 }``.
126+
94127
Additional Query Tutorials
95128
--------------------------
96129

source/tutorial/remove-documents.txt

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,11 @@ Delete Documents
2020

2121
You can delete documents in MongoDB using the following methods:
2222

23-
- Your programming language's driver
24-
- The :atlas:`{+atlas+} UI </>`. To learn more, see
25-
:ref:`delete-documents-atlas-ui`.
26-
- :compass:`MongoDB Compass </>`
23+
.. |atlas-ref| replace:: :ref:`delete-documents-atlas-ui`
2724

28-
----------
25+
.. include:: /includes/fact-methods.rst
2926

30-
.. |arrow| unicode:: U+27A4
31-
32-
|arrow| Use the **Select your language** drop-down menu in the
33-
upper-right to set the language of the following examples.
34-
35-
----------
27+
.. include:: /includes/language-selector-instructions.rst
3628

3729
.. tabs-selector:: drivers
3830

@@ -690,10 +682,7 @@ To delete a document in {+atlas+}, follow these steps:
690682

691683
.. step:: Navigate to the collection.
692684

693-
a. In the {+atlas+} UI, click :guilabel:`Database` in the sidebar.
694-
#. For the database deployment that contains the sample data, click :guilabel:`Browse Collections`.
695-
#. In the left navigation pane, select the :guilabel:`sample_mflix` database.
696-
#. Select the :guilabel:`movies` collection.
685+
.. include:: /includes/steps-nav-atlas-sample-movies.rst
697686

698687
.. step:: Specify a query filter document.
699688

0 commit comments

Comments
 (0)