getMore
정의
호환성
이 명령은 다음 환경에서 호스팅되는 배포에서 사용할 수 있습니다.
MongoDB Atlas: 클라우드에서의 MongoDB 배포를 위한 완전 관리형 서비스
참고
이 명령은 모든 MongoDB Atlas 클러스터에서 지원됩니다. 모든 명령에 대한 Atlas 지원에 관해 자세히 알아보려면 지원되지 않는 명령을 참조하십시오.
MongoDB Enterprise: MongoDB의 구독 기반 자체 관리 버전
MongoDB Community: MongoDB의 소스 사용 가능 무료 자체 관리 버전
구문
명령은 다음과 같은 구문을 가집니다:
db.runCommand( { getMore: <long>, collection: <string>, batchSize: <int>, maxTimeMS: <int>, comment: <any> } )
명령 필드
이 명령에는 다음과 같은 필드를 사용할 수 있습니다.
필드 | 유형 | 설명 |
---|---|---|
| long | The cursor identifier. |
| 문자열 | The name of the collection over which the cursor is operating. |
| positive integer | Optional. The number of documents to return in the batch. If |
| non-negative integer | 선택 사항. Specifies the maximum time for the server to wait for new documents
that match a 테일 커서(tailable cursor)
query on a 고정 사이즈 컬렉션..
MongoDB terminates operations that exceed their allotted time limit
using the same mechanism as
|
| any | 선택 사항. 이 명령에 첨부할 사용자 제공 코멘트입니다. 설정되면 이 설명은 다음 위치에서 이 명령의 레코드와 함께 표시됩니다.
댓글은 유효한 모든 BSON types (문자열, 정수, 객체, 배열 등)이 될 수 있습니다. If omitted, |
출력
The command returns a document that contains the cursor information as well as the next batch.
For example, running getMore
on a cursor created by a
find
operation on a sharded cluster returns a document
similar to this output:
{ "cursor" : { "id" : NumberLong("678960441858272731"), "ns" : "test.contacts", "nextBatch" : [ { "_id" : ObjectId("5e8e501e1a32d227f9085857"), "zipcode" : "220000" } ], "partialResultsReturned" : true, "postBatchResumeToken": "< Resume Token >" }, "ok" : 1, "operationTime" : Timestamp(1586385239, 2), "$clusterTime" : { "clusterTime" : Timestamp(1586385239, 2), "signature" : { "hash" : BinData(0,"lLjejeW6AQGReR9x1PD8xU+tP+A="), "keyId" : NumberLong("6813467763969884181") } } }
필드 | 설명 |
---|---|
| Contains the cursor information, including the
cursor ID as well as the 쿼리된 샤드 를 사용할 The |
| 명령에 성공했는지( |
In addition to these fields, the db.runCommand()
response
includes the following information for replica sets and sharded
clusters:
$clusterTime
operationTime
See db.runCommand() Response for details.
행동
액세스 제어
If 인증 is enabled, you can
only run getMore
against cursors you created.
세션
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.
트랜잭션
다중 문서 트랜잭션의 경우:
느린 쿼리
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.
MongoDB 8.0부터 기존 queryHash
필드 planCacheShapeHash
라는 새 필드 에 중복됩니다. 이전 MongoDB 버전을 사용하는 경우 queryHash
필드 만 표시됩니다. 향후 MongoDB 버전에서는 더 이상 사용되지 않는 queryHash
필드 제거 될 예정이며, 대신 planCacheShapeHash
필드 사용해야 합니다.