@@ -16,9 +16,8 @@ Overview
1616Read operations that return multiple documents do not immediately return
1717all values matching the query. Because a query can potentially match
1818very large sets of documents, these operations rely upon an
19- object called a :node-api:`cursor <Cursor.html>`
20- that fetches documents in batches to reduce both memory consumption and
21- network bandwidth usage. Cursors are highly configurable and offer
19+ object called a cursor. A cursor fetches documents in batches to reduce both
20+ memory consumption and network bandwidth usage. Cursors are highly configurable and offer
2221multiple interaction paradigms for different use cases.
2322
2423The following functions directly return cursors:
@@ -72,8 +71,7 @@ pulling all matching documents into a collection in process memory.
7271For Each Functional Iteration
7372~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7473
75- You can pass a function to the :node-api:`forEach()
76- <Cursor.html#forEach>` method of any cursor to iterate through
74+ You can pass a function to the :node-api-4.0:`forEach() </classes/findcursor.html#foreach>` method of any cursor to iterate through
7775results in a functional style:
7876
7977.. literalinclude:: /code-snippets/crud/cursor.js
@@ -96,9 +94,9 @@ allows you to use cursors in ``for``...``await`` loops:
9694Manual Iteration
9795~~~~~~~~~~~~~~~~
9896
99- You can use the :node-api:`hasNext() <Cursor .html#hasNext >`
97+ You can use the :node-api-4.0 :`hasNext() </classes/findcursor .html#hasnext >`
10098method to check if a cursor can provide additional data, and then use
101- the :node-api:`next() <Cursor .html#next>`
99+ the :node-api-4.0 :`next() </classes/findcursor .html#next>`
102100method to retrieve the subsequent element of the cursor:
103101
104102.. literalinclude:: /code-snippets/crud/cursor.js
@@ -132,10 +130,9 @@ Fetch All Documents At Once
132130~~~~~~~~~~~~~~~~~~~~~~~~~~~
133131
134132For use cases that require all documents matched by a query to be held
135- in memory at the same time, use :node-api:`toArray()
136- <Cursor.html#toArray>`. Note that large sets of
137- matched documents can cause performance issues or even failures due to
138- exceeding memory constraints.
133+ in memory at the same time, use :node-api-4.0:`toArray() </classes/findcursor.html#toarray>`.
134+ Note that large sets of matched documents can cause performance issues or even
135+ failures due to exceeding memory constraints.
139136
140137.. literalinclude:: /code-snippets/crud/cursor.js
141138 :language: javascript
@@ -150,7 +147,7 @@ Count
150147~~~~~
151148
152149For an estimated count of the number of documents referenced by the
153- cursor, use :node-api:`count() <Cursor .html#count>`:
150+ cursor, use :node-api-4.0 :`count() </classes/findcursor .html#count>`:
154151
155152.. literalinclude:: /code-snippets/crud/cursor.js
156153 :language: javascript
@@ -161,7 +158,7 @@ Rewind
161158~~~~~~
162159
163160To reset a cursor to its initial position in the set of returned
164- documents, use :node-api:`rewind() <Cursor .html#rewind>`.
161+ documents, use :node-api-4.0 :`rewind() </classes/findcursor .html#rewind>`.
165162
166163.. literalinclude:: /code-snippets/crud/cursor.js
167164 :language: javascript
@@ -173,7 +170,7 @@ Close
173170
174171Cursors consume memory and network resources both in the client
175172application and in the connected instance of MongoDB. Use
176- :node-api:`close() <Cursor .html#close>`
173+ :node-api-4.0 :`close() </classes/findcursor .html#close>`
177174to free up a cursor's resources in both the client application
178175and the MongoDB server:
179176
0 commit comments