@@ -27,8 +27,8 @@ operation by using the following methods:
27
27
- ``SetSkip()``: Specifies the number of documents to skip before returning query results.
28
28
- ``SetLimit()``: Specifies the maximum number of documents to return from a query.
29
29
30
- Sample Data for Examples
31
- ~~~~~~~~~~~~~~~~~~~~~~~~
30
+ Sample Data
31
+ ~~~~~~~~~~~
32
32
33
33
The examples in this guide use the following ``Course`` struct as a model for documents
34
34
in the ``courses`` collection:
@@ -83,12 +83,9 @@ specify this sort, pass the field you want to sort by and ``1`` to the
83
83
.. tip::
84
84
85
85
With an ascending sort, the method orders values of type
86
- ``Boolean`` from ``false`` *to* ``true``, ``String`` type values
87
- from *a to z* and numeric type values from *negative infinity to
88
- positive infinity*.
89
-
90
- Example
91
- ```````
86
+ ``Boolean`` from ``false`` to ``true``, ``String`` type values
87
+ from a to z and numeric type values from negative infinity to
88
+ positive infinity.
92
89
93
90
The following example specifies an ascending sort on the ``enrollment`` field:
94
91
@@ -131,12 +128,9 @@ specify this sort, pass the field you want to sort by and ``-1`` to the
131
128
.. tip::
132
129
133
130
With an descending sort, the method orders values of type
134
- ``Boolean`` from ``true`` *to* ``false``, ``String`` type values
135
- from *z to a* and numeric type values from *positive infinity to
136
- negative infinity*.
137
-
138
- Example
139
- ```````
131
+ ``Boolean`` from ``true`` to ``false``, ``String`` type values
132
+ from z to a and numeric type values from positive infinity to
133
+ negative infinity.
140
134
141
135
The following example specifies a descending sort on the ``enrollment`` field:
142
136
@@ -189,9 +183,6 @@ You can sort on additional fields to resolve ties in the original sort.
189
183
If you want to guarantee a specific order for documents, select sort fields
190
184
that do not result in ties.
191
185
192
- Example
193
- ```````
194
-
195
186
The following example specifies a descending sort on the ``enrollment`` field,
196
187
then an ascending sort on the ``title`` field:
197
188
@@ -231,9 +222,6 @@ Aggregation
231
222
You can also include the :manual:`$sort </reference/operator/aggregation/sort/>`
232
223
stage to specify a sort in an aggregation pipeline.
233
224
234
- Example
235
- ```````
236
-
237
225
The following example specifies a descending sort on the ``enrollment``
238
226
field, then an ascending sort on the ``title`` field:
239
227
0 commit comments