File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
source/fundamentals/crud/read-operations Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -78,24 +78,23 @@ For more information on the ``options`` settings for the ``find()``
78
78
method, see the
79
79
:node-api:`API documentation on find() <Collection.html#find>`.
80
80
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:
84
83
85
84
.. code-block:: javascript
86
- :emphasize-lines: 4
85
+ :emphasize-lines: 6,7
87
86
88
87
// define an empty query document
89
88
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 };
92
91
const limit = 3;
93
92
const skip = 3;
94
93
const cursor = collection.find(query).sort(sort).limit(limit).skip(skip);
95
94
await cursor.forEach(console.dir);
96
95
97
96
This operation returns the documents that describe the fourth through sixth
98
- longest books :
97
+ books in order of longest-to-shortest length :
99
98
100
99
.. code-block:: javascript
101
100
You can’t perform that action at this time.
0 commit comments