On this page本页内容
The getMore
command has the following form:getMore
命令的格式如下:
db.runCommand( { "getMore": <long>, "collection": <string>, "batchSize": <int>, "maxTimeMS": <int>, "comment": <any> } )
The command accepts the following fields:该命令接受以下字段:
getMore | long | |
collection | string | |
batchSize | positive integer | |
maxTimeMS | non-negative integer |
|
comment | any |
|
The command returns a document that contains the cursor information as well as the next batch.该命令返回包含游标信息以及下一批的文档。
For example, a document similar to the one below may be returned when getMore
is run on a cursor that was originally created by a find
operation on a sharded cluster:
{ "cursor" : { "id" : NumberLong("678960441858272731"), "ns" : "test.contacts", "nextBatch" : [ { "_id" : ObjectId("5e8e501e1a32d227f9085857"), "zipcode" : "220000" } ], "partialResultsReturned" : true }, "ok" : 1, "operationTime" : Timestamp(1586385239, 2), "$clusterTime" : { "clusterTime" : Timestamp(1586385239, 2), "signature" : { "hash" : BinData(0,"lLjejeW6AQGReR9x1PD8xU+tP+A="), "keyId" : NumberLong("6813467763969884181") } } }
cursor | Contains the cursor information, including the cursor id as well as the Starting in 4.4, if the cursor from a If the queried shards are initially available for the |
"ok" | Indicates whether the command has succeeded (1 ) or failed (0 ). |
In addition to the aforementioned getMore
-specific fields, the db.runCommand()
includes the following information for replica sets and sharded clusters:
$clusterTime
operationTime
See db.runCommand() Results for details.有关详细信息,请参阅db.runCommand()
结果。
If authentication is turned on, you can only issue a getMore
against cursors you created.
New in version 4.0.在版本4.0中新增。
For cursors created inside a session, you cannot call getMore
outside the session.
Similarly, for cursors created outside of a session, you cannot call getMore
inside a session.
New in version 4.0.在版本4.0中新增。
For multi-document transactions:对于多文档事务:
Starting in MongoDB 5.1, when a getMore
command is logged as a slow query, the queryHash and planCacheKey fields are added to the slow query log message and the profiler log message.