@@ -17,7 +17,7 @@ Definition
17
17
18
18
.. dbcommand:: getMore
19
19
20
- Use in conjunction with commands that return a cursor, e.g.
20
+ Use in conjunction with commands that return a cursor. For example,
21
21
:dbcommand:`find` and :dbcommand:`aggregate`, to return subsequent
22
22
batches of documents currently pointed to by the cursor.
23
23
@@ -53,7 +53,7 @@ The command accepts the following fields:
53
53
54
54
* - ``getMore``
55
55
- long
56
- - The cursor id .
56
+ - The cursor identifier .
57
57
58
58
* - ``collection``
59
59
- string
@@ -62,7 +62,11 @@ The command accepts the following fields:
62
62
* - ``batchSize``
63
63
- positive integer
64
64
- Optional. The number of documents to return in the batch.
65
-
65
+
66
+ If ``batchSize`` is not set, ``getMore`` returns up to 16
67
+ megabytes of data. If ``batchSize`` is set, ``getMore`` returns
68
+ the smaller of 16 megabytes of data or ``batchSize`` documents.
69
+
66
70
* - ``maxTimeMS``
67
71
- non-negative integer
68
72
- Optional.
@@ -91,7 +95,7 @@ The command accepts the following fields:
91
95
terminates an operation at one of its designated :term:`interrupt points <interrupt point>`.
92
96
93
97
- You cannot set ``maxTimeMS`` when calling ``getMore`` on a
94
- non-tailable cursor. Instead, set it via
98
+ non-tailable cursor. Instead, set it using
95
99
:method:`~cursor.maxTimeMS()` when you create the cursor.
96
100
- To use ``getMore`` with ``maxTimeMS`` on a tailable cursor,
97
101
enable ``awaitData`` when you create the cursor using :method:`cursor.tailable()`.
@@ -122,9 +126,10 @@ as well as the next batch.
122
126
123
127
For example, running ``getMore`` on a cursor created by a
124
128
:dbcommand:`find` operation on a sharded cluster returns a document
125
- similar to the one below :
129
+ similar to this output :
126
130
127
131
.. code-block:: javascript
132
+ :copyable: false
128
133
129
134
{
130
135
"cursor" : {
@@ -190,7 +195,7 @@ Behavior
190
195
Access Control
191
196
~~~~~~~~~~~~~~
192
197
193
- If :ref:`authentication <authentication>` is turned on , you can
198
+ If :ref:`authentication <authentication>` is enabled , you can
194
199
only run ``getMore`` against cursors you created.
195
200
196
201
Sessions
@@ -213,3 +218,9 @@ Slow Queries
213
218
~~~~~~~~~~~~
214
219
215
220
.. include:: /includes/getMore-slow-queries.rst
221
+
222
+ Learn More
223
+ ----------
224
+
225
+ - :ref:`cursor-batchSize`
226
+ - :ref:`read-operations-cursors`
0 commit comments