@@ -32,7 +32,7 @@ examples in the shell above.
32
32
:tabid: example-1
33
33
34
34
Switch Database
35
- ~~~~~~~~~~~~~~~
35
+ ---------------
36
36
37
37
Within the :ref:`shell <mongo-web-shell>`, ``db`` refers to
38
38
your current database. Type ``db`` to display the current
@@ -69,7 +69,7 @@ examples in the shell above.
69
69
:tabid: example-2
70
70
71
71
Populate a Collection (Insert)
72
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72
+ ------------------------------
73
73
74
74
MongoDB stores documents in :doc:`collections
75
75
</core/databases-and-collections>`. Collections are analogous to
@@ -160,7 +160,7 @@ examples in the shell above.
160
160
:tabid: example-3
161
161
162
162
Select All Documents
163
- ~~~~~~~~~~~~~~~~~~~~
163
+ --------------------
164
164
165
165
To select the documents from a collection, you can use the
166
166
:method:`db.collection.find()` method. To select all documents
@@ -179,7 +179,7 @@ examples in the shell above.
179
179
:tabid: example-4
180
180
181
181
Filter Data with Comparison Operators
182
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
182
+ -------------------------------------
183
183
184
184
For an equality match (``<field>`` equals ``<value>``),
185
185
specify ``<field>: <value>`` in the :ref:`query filter
@@ -227,7 +227,7 @@ examples in the shell above.
227
227
:tabid: example-5
228
228
229
229
Specify Fields to Return (Projection)
230
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
230
+ -------------------------------------
231
231
232
232
To specify fields to return, pass a projection document to the
233
233
:method:`db.collection.find(\<query document\>, \<projection
@@ -260,17 +260,17 @@ examples in the shell above.
260
260
:tabid: example-6
261
261
262
262
Aggregate Data (:pipeline:`$group`)
263
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
263
+ -----------------------------------
264
264
265
265
You can use aggregation to group values from multiple documents
266
266
together and return a single result. Aggregation in MongoDB
267
267
is performed with an :ref:`aggregation pipeline
268
268
<aggregation-framework>`.
269
269
270
- While :method:`find()` operations are useful for data
271
- retrieval, the aggregation pipeline allows you to manipulate
272
- data, perform calculations, and write more expressive queries
273
- than simple :ref:`CRUD operations <crud>`.
270
+ While :method:`~db.collection. find()` operations are useful for
271
+ data retrieval, the aggregation pipeline allows you to manipulate
272
+ data, perform calculations, and write more expressive queries than
273
+ simple :ref:`CRUD operations <crud>`.
274
274
275
275
In the :ref:`shell <mongo-web-shell>`, run the following
276
276
aggregation pipeline to count the number of occurrences
0 commit comments