AI 에이전트의 경우: 문서 인덱스는 https://www.mongodb.com/ko-kr/docs/llms.txt에서 사용할 수 있으며, 모든 페이지의 마크다운 버전은 어떤 URL 경로에 .md를 추가하여 사용할 수 있습니다.
Docs Menu

커서.maxAwaitTimeMS() (mongosh 메서드)

cursor.maxAwaitTimeMS(<time limit>)

중요

Mongo쉬 방법

This page documents a mongosh method. This is not the documentation for a language-specific driver, such as Node.js.

MongoDB API 드라이버의 경우 언어별 MongoDB 드라이버 설명서를 참조하세요.

서버가 고정 사이즈 컬렉션 의 테일 커서(tailable cursor) 쿼리와 일치하는 새 문서를 기다리는 최대 시간을 지정합니다. 쿼리에서 반환된 커서를 반복하는 방법에 대한 자세한 내용 은 mongosh 에서 커서 반복을 참조하세요.

The maxAwaitTimeMS() method has the following prototype form:

db.collection.find(
{ <query> },
{ <projection> }
).tailable( { awaitData: true } ).maxAwaitTimeMS( <milliseconds> )

The maxAwaitTimeMS() method has the following parameter:

Parameter
유형
설명

milliseconds

integer

새 문서의 최대 대기 시간을 지정합니다.

중요

This method, maxAwaitTimeMS(), sets a limit on how long a tailable cursor waits for the next response. maxTimeMS() sets a limit on total processing time.

이 메서드는 다음 환경에서 호스팅되는 배포에서 사용할 수 있습니다.

  • MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud

참고

This command is supported in all MongoDB Atlas clusters. For information on Atlas support for all commands, see Unsupported Commands.

고정 사이즈 sales 컬렉션을 쿼리하여 마리 케이(Mary Kay) 에이전트의 주간 매출 합계를 찾습니다.

db.sales.find(
{ agent: "Mary Kay" },
{ _id: 0, agent: 1, weeklyTotal: 1 }
).tailable( { awaitData: true } ).maxAwaitTimeMS( 1000 )

The highlighted line creates a tailable cursor on the sales collection. The maxAwaitTimeMS() sets a one second maximum wait time for the next cursor update.

이 페이지 평가하기

이 페이지의 내용