@@ -76,12 +76,11 @@ The following example specifies an ascending sort on the ``rating`` field:
7676 :end-before: end ascending sort
7777 :emphasize-lines: 2-3, 5
7878
79- After running the preceding example, the output resembles the following:
79+ After running this example, the output resembles the following:
8080
8181.. code-block:: none
8282 :copyable: false
8383
84- //results truncated
8584 [{_id ObjectID("...")} {type Assam} {rating 5}]
8685 [{_id ObjectID("...")} {type English Breakfast} {rating 5}]
8786 [{_id ObjectID("...")} {type Oolong} {rating 7}]
@@ -114,7 +113,7 @@ The following example specifies a descending sort on the ``rating`` field:
114113 :end-before: end descending sort
115114 :emphasize-lines: 2-3, 5
116115
117- After running the preceding example, the output resembles the following:
116+ After running this example, the output resembles the following:
118117
119118.. code-block:: none
120119 :copyable: false
@@ -157,7 +156,7 @@ then a descending sort on the ``type`` field:
157156 :end-before: end multi sort
158157 :emphasize-lines: 2-3, 5
159158
160- After running the preceding example, the output resembles the following:
159+ After running this example, the output resembles the following:
161160
162161.. code-block:: none
163162 :copyable: false
@@ -168,19 +167,34 @@ After running the preceding example, the output resembles the following:
168167 [{_id ObjectID("...")} {type Earl Grey} {rating 8}]
169168 [{_id ObjectID("...")} {type Masala} {rating 10}]
170169
171- .. tip:: Using Aggregation
170+ Aggregation
171+ ~~~~~~~~~~~
172+
173+ You can also include the :manual:`$sort </reference/operator/aggregation/sort/>`
174+ stage to specify a sort in an aggregation pipeline.
175+
176+ Example
177+ ```````
172178
173- You can also include the :manual:`$sort </reference/operator/aggregation/sort/>`
174- stage to specify a sort in an aggregation pipeline.
179+ The following example specifies a descending sort on the ``rating``
180+ field, then an ascending sort on the ``type`` field:
181+
182+ .. literalinclude:: /includes/fundamentals/code-snippets/CRUD/sort.go
183+ :language: go
184+ :dedent:
185+ :start-after: begin aggregate sort
186+ :end-before: end aggregate sort
175187
176- The following example specifies the same sort from the preceding
177- example in an aggregation pipeline:
188+ After running this example, the output resembles the following:
178189
179- .. literalinclude:: /includes/fundamentals/code-snippets/CRUD/sort.go
180- :language: go
181- :dedent:
182- :start-after: begin aggregate sort
183- :end-before: end aggregate sort
190+ .. code-block:: none
191+ :copyable: false
192+
193+ [{_id ObjectID("...")} {type Masala} {rating 10}]
194+ [{_id ObjectID("...")} {type Earl Grey} {rating 8}]
195+ [{_id ObjectID("...")} {type Oolong} {rating 7}]
196+ [{_id ObjectID("...")} {type Assam} {rating 5}]
197+ [{_id ObjectID("...")} {type English Breakfast} {rating 5}]
184198
185199Additional Information
186200----------------------
0 commit comments