@@ -106,7 +106,7 @@ array and then sorts all the elements of the array by the ascending
106
106
``quizzes``; i.e. ``{ score: 1 }`` and **not** ``{ "quizzes.score": 1}``
107
107
108
108
After the update, the array elements are in order of ascending
109
- ``score`` field. :
109
+ ``score`` field:
110
110
111
111
.. code-block:: javascript
112
112
@@ -130,7 +130,7 @@ A collection ``students`` contains the following document:
130
130
131
131
{ "_id" : 2, "tests" : [ 89, 70, 89, 50 ] }
132
132
133
- The following operation adds two more elements to the ``scores `` array
133
+ The following operation adds two more elements to the ``tests `` array
134
134
and sorts the elements:
135
135
136
136
.. code-block:: javascript
@@ -140,7 +140,7 @@ and sorts the elements:
140
140
{ $push: { tests: { $each: [ 40, 60 ], $sort: 1 } } }
141
141
)
142
142
143
- The updated document has the elements of the ``scores `` array in
143
+ The updated document has the elements of the ``tests `` array in
144
144
ascending order:
145
145
146
146
.. code-block:: javascript
@@ -158,7 +158,7 @@ A collection ``students`` contains the following document:
158
158
159
159
To update the ``tests`` field to sort its elements in descending
160
160
order, specify the ``{ $sort: -1 }`` and specify an empty array ``[]``
161
- for the :update:`$each` modifier, as in the following :
161
+ for the :update:`$each` modifier. For example :
162
162
163
163
.. code-block:: javascript
164
164
@@ -167,8 +167,7 @@ for the :update:`$each` modifier, as in the following:
167
167
{ $push: { tests: { $each: [ ], $sort: -1 } } }
168
168
)
169
169
170
- The result of the operation is to update the ``scores`` field to sort
171
- its elements in descending order:
170
+ The example sorts the ``tests`` field values in descending order:
172
171
173
172
.. code-block:: javascript
174
173
@@ -179,5 +178,5 @@ Use ``$sort`` with Other ``$push`` Modifiers
179
178
180
179
.. include:: /includes/example-push-with-multiple-modifiers.rst
181
180
182
- The order of the modifiers is immaterial to the order in which the
183
- modifiers are processed. See :ref:`push-modifiers` for details .
181
+ The order of the modifiers in the query does not change the order that
182
+ the modifiers are applied. For details, see :ref:`push-modifiers`.
0 commit comments