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