getMore
Definition
New in version 3.2.
Use in conjunction with commands that return a cursor, e.g.find
and aggregate
, to return subsequentbatches of documents currently pointed to by the cursor.
The getMore
command has the following form:
- {
- "getMore": <long>,
- "collection": <string>,
- "batchSize": <int>,
- "maxTimeMS": <int>
- }
The command accepts the following fields:
FieldTypeDescriptiongetMore
longThe cursor id.collection
stringThe name of the collection over which the cursor is operating.batchSize
positive integerOptional. The number of documents to return in the batch.maxTimeMS
non-negative integerOptional. Specifies a time limit in milliseconds for processingoperations on a cursor. If you do not specify a value for maxTimeMS,operations will not time out. A value of 0
explicitlyspecifies the default unbounded behavior.
MongoDB terminates operations that exceed their allotted time limitusing the same mechanism as db.killOp()
. MongoDB onlyterminates an operation at one of its designated interruptpoints.
Behavior
Access Control
New in version 3.6.
If authentication is turned on, you canonly issue a getMore
against cursors you created.
Sessions
New in version 4.0.
For cursors created inside a session, you cannot callgetMore
outside the session.
Similarly, for cursors created outside of a session, you cannot callgetMore
inside a session.
Transactions
New in version 4.0.