Skip to content

Commit 35c1f8b

Browse files
committed
DOCS-675 incorporate Scotts friday feedback
1 parent 2ff5702 commit 35c1f8b

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

source/applications/read.txt

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,6 @@ as in the following example:
338338

339339
db.bios.find( { _id: 1 } );
340340

341-
This operation will iterate the cursor up to 20 times and print the
342-
first 20 documents referenced by the cursor.
343-
344341
If the result of the :method:`find() <db.collection.find()>` is
345342
assigned to a variable:
346343

@@ -459,29 +456,34 @@ its behavior, such as:
459456

460457
db.bios.find().skip( 5 )
461458

462-
You may chain these cursor methods; however, the :method:`limit()
463-
<cursor.limit()>` method is always applied after the :method:`sort()
464-
<cursor.sort()>` even if you chain the methods in the reverse
465-
order [#dbquery-server]_:
459+
You can chain these cursor methods, as in the following examples [#dbquery-server]_:
466460

467461
.. code-block:: javascript
468462

463+
db.bios.find().sort( { name: 1 } ).limit( 5 )
469464
db.bios.find().limit( 5 ).sort( { name: 1 } )
470465

471466
See :ref:`JavaScript cursor methods <js-query-cursor-methods>` and your
472467
:doc:`driver </applications/drivers>` documentation for more
473468
information on cursor methods. See :ref:`read-operations-cursors` for
474469
more information regarding cursors.
475470

476-
.. [#dbquery-server] The server treats the query with the sort as a
477-
single object:
471+
.. [#dbquery-server] Regardless of the order you chain the :method:`limit()
472+
<cursor.limit()>` and the :method:`sort() <cursor.sort()>`, the
473+
request to the server has the following structure that treats the
474+
query and the :method:`sort() <cursor.sort()>` modifier as a single
475+
object:
478476

479477
.. code-block:: javascript
480478

481479
db.bios.find( { $query: {}, $orderby: { name: 1 } } ).limit( 5 )
482480

483-
For other cursor modifiers that are treated with the query as a
484-
single object, see the :doc:`meta query operators
481+
This structure means that the :method:`limit() <cursor.limit()>`
482+
method is always applied after the :method:`sort() <cursor.sort()>`
483+
regardless of the order in which the client chains the two methods.
484+
485+
For other cursor modifiers that are sent with the
486+
query as a single object to the server, see the :doc:`meta query operators
485487
</reference/meta-query-operators>`.
486488

487489
.. _crud-read-findOne:

0 commit comments

Comments
 (0)