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