Use in conjunction with commands that return a cursor, e.g.
find and aggregate, to return subsequent
batches of documents currently pointed to by the cursor.
The command has the following syntax:
The command accepts the following fields:
The cursor id.
The name of the collection over which the cursor is operating.
Optional. The number of documents to return in the batch.
Specifies a time limit in milliseconds for processing
operations on a cursor. If you do not specify a value for
maxTimeMS, operations will not time out. A value of 0
explicitly specifies the default unbounded behavior.
MongoDB terminates operations that exceed their allotted time limit
using the same mechanism as db.killOp(). MongoDB only
terminates an operation at one of its designated interrupt
With tailable cursors:
maxTimeMS on getMore specifies the maximum amount of time
MongoDB waits for new documents to be added to the cursor for that
specific getMore command. If no value is provided, this defaults
to 1000 milliseconds.
The command that creates the cursor only sets maxTimeMS for the
initial operation. It does not set maxTimeMS for subsequent operations.
Set maxTimeMS individually for each call to getMore.
A timeout on getMore will retain the documents accumulated
before the timeout occurred in the cursor.
With non-tailable cursors:
The command that creates the cursor sets maxTimeMS. This
is the maximum amount of time that the initial operation, and
any subsequent operations, can spend on the entire cursor.
A timeout on getMore raises an error.
maxTimeMS cannot be set when getMore is called on a
A user-provided comment to attach to this command. Once set, this
comment appears alongside records of this command in the following
Contains the cursor information, including the
cursor id as well as the nextBatch of documents.
Starting in 4.4, if the cursor from a find command
returns partial results due to the unavailability of the queried
shard(s), the cursor document includes a
partialResultsReturned field. To return partial results,
rather than error, due to the unavailability of the queried
shard(s), the initial find command must run with
allowPartialResults set to
true. See allowPartialResults.
If the queried shards are initially available for the
find command but one or more shards become
unavailable in subsequent getMore commands, only
the getMore commands run when a queried shard or
shards are unavailable include the partialResultsReturned
flag in the output.
Indicates whether the command has succeeded (1) or failed
In addition to the aforementioned getMore-specific fields,
the db.runCommand() includes the following information for
replica sets and sharded clusters: