Skip to content

Commit 1a0837c

Browse files
author
Chris Cho
authored
DOCSP-15136: fix text in fundamentals limit page (#152)
* DOCSP-15136: fix text in fundamentals limit page
1 parent 763a2d9 commit 1a0837c

File tree

1 file changed

+6
-7
lines changed
  • source/fundamentals/crud/read-operations

1 file changed

+6
-7
lines changed

source/fundamentals/crud/read-operations/limit.txt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,24 +78,23 @@ For more information on the ``options`` settings for the ``find()``
7878
method, see the
7979
:node-api:`API documentation on find() <Collection.html#find>`.
8080

81-
To see the next three longest books, append the ``skip()`` method, passing
82-
the number of documents to skim over to the previous code snippet's call to
83-
``find()``:
81+
To see the next three books in the results, append the ``skip()`` method,
82+
passing the number of documents to bypass as shown below:
8483

8584
.. code-block:: javascript
86-
:emphasize-lines: 4
85+
:emphasize-lines: 6,7
8786

8887
// define an empty query document
8988
const query = {};
90-
// sort in ascending (1) order by length
91-
const sort = { length: 1 };
89+
// sort in descending (-1) order by length
90+
const sort = { length: -1 };
9291
const limit = 3;
9392
const skip = 3;
9493
const cursor = collection.find(query).sort(sort).limit(limit).skip(skip);
9594
await cursor.forEach(console.dir);
9695

9796
This operation returns the documents that describe the fourth through sixth
98-
longest books:
97+
books in order of longest-to-shortest length:
9998

10099
.. code-block:: javascript
101100

0 commit comments

Comments
 (0)