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

Bulk.find.replaceOne() (mongosh 메서드)

팁

MongoDB는 대량 쓰기 작업을 수행하기 위한 Mongo.bulkWrite() 메서드도 제공합니다.

Bulk.find.replaceOne(<document>)

Adds a single document replacement operation to a bulk operations list. Use the Bulk.find() method to specify the condition that determines which document to replace. The Bulk.find.replaceOne() method limits the replacement to a single document.

Bulk.find.replaceOne() 는 다음 매개 변수를 허용합니다.

Parameter
유형
설명

replacement

문서

기존 문서를 완전히 대체하는 대체 문서입니다. 필드 및 값 쌍만 포함합니다.

Bulk.find() 의 연관된 <query> 문서와 대체 문서의 합계는 최대 BSON 문서 크기보다 작거나 같아야 합니다.

이 작업에 대한 업서트 를 지정하려면 Bulk.find.upsert() 를 참조하세요.

연계된 Bulk.find()에 사용할 인덱스를 지정하려면 Bulk.find.hint()를 참조하세요.

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

  • 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.

The following example initializes a Bulk() operations builder for the items collection, and adds various replaceOne() operations to the list of operations.

var bulk = db.items.initializeUnorderedBulkOp();
bulk.find( { item: "abc123" } ).replaceOne( { item: "abc123", status: "P", points: 100 } );
bulk.execute();
이 페이지 평가하기

이 페이지의 내용