정의
cursor.maxAwaitTimeMS(<time limit>)중요
Mongo쉬 방법
This page documents a
mongoshmethod. 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유형설명millisecondsinteger
새 문서의 최대 대기 시간을 지정합니다.
중요
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.
MongoDB Enterprise: MongoDB의 구독 기반 자체 관리 버전
MongoDB Community: MongoDB의 소스 사용 가능 무료 자체 관리 버전
예시
고정 사이즈 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.