Skip to content

Commit 85f7bd3

Browse files
authored
Docsp 44857 improve retrieve (#139)
1 parent 4ddd435 commit 85f7bd3

File tree

3 files changed

+22
-15
lines changed

3 files changed

+22
-15
lines changed

source/fundamentals/aggregation.txt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,11 @@ month.
183183

184184
The aggregation pipeline contains the following stages:
185185

186-
- A ``$project`` stage to extract the month from the ``last_active``
187-
field as a number into the ``month_last_active`` field.
188-
- A ``$group`` stage to group documents by the ``month_last_active``
189-
field and count the number of documents for each month.
190-
- A ``$sort`` stage to set an ascending sort on the month.
186+
- ``$project`` stage to extract the month from the ``last_active``
187+
field as a number into the ``month_last_active`` field
188+
- ``$group`` stage to group documents by the ``month_last_active``
189+
field and count the number of documents for each month
190+
- ``$sort`` stage to set an ascending sort on the month
191191

192192
.. io-code-block::
193193

@@ -216,12 +216,12 @@ often they appear in users' interests.
216216

217217
The aggregation pipeline contains the following stages:
218218

219-
- An ``$unwind`` stage to separate each array entry in the
220-
``genre_interests`` field into a new document.
221-
- A ``$group`` stage to group documents by the ``genre_interests``
222-
field and count the number of documents for each genre.
223-
- A ``$sort`` stage to set a descending sort on the genre popularity.
224-
- A ``$limit`` stage to show only the first three genres.
219+
- ``$unwind`` stage to separate each array entry in the
220+
``genre_interests`` field into a new document
221+
- ``$group`` stage to group documents by the ``genre_interests``
222+
field and count the number of documents for each genre
223+
- ``$sort`` stage to set a descending sort on the genre popularity
224+
- ``$limit`` stage to show only the first three genres
225225

226226
.. io-code-block::
227227

source/fundamentals/crud/read-operations/query.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ The examples in the following sections query a collection of documents described
111111
:start-after: begin-sample-docs
112112
:end-before: end-sample-docs
113113

114+
To learn how to insert this data into a collection, see the
115+
:ref:`rust-insert-guide` guide.
116+
114117
.. _rust-literal-values:
115118

116119
Literal Values
@@ -240,7 +243,7 @@ divisible by ``3``:
240243
.. code-block:: rust
241244

242245
my_coll.find(doc! {
243-
$and: [
246+
"$and": [
244247
doc! { "price": { "$eq": 5 }},
245248
doc! { "quantity": { "$gt": 4 }}
246249
]

source/fundamentals/crud/read-operations/retrieve.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ information about its categorization and unit price:
5959
:start-after: start-sample
6060
:end-before: end-sample
6161

62+
To learn how to insert this data into a collection, see the
63+
:ref:`rust-insert-guide` guide.
64+
6265
.. _rust-retrieve-find:
6366

6467
Find Operations
@@ -349,9 +352,10 @@ Example
349352
This example shows how to call the ``aggregate()`` method with a
350353
pipeline that contains the following stages:
351354

352-
- A ``$group`` stage to group documents by the ``category`` field and
353-
calculate the average of the ``unit_price`` field by ``category``
354-
- A ``$sort`` stage to by ``avg_price`` in ascending order
355+
- ``$group`` stage to calculate the average of the ``unit_price``
356+
field for each value of the ``category`` field
357+
- ``$sort`` stage to order results by ``avg_price`` in ascending
358+
order
355359

356360
.. io-code-block::
357361
:copyable: true

0 commit comments

Comments
 (0)