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

Bulk.toJSON() (mongosh 메서드)

Bulk.toJSON()

Bulk() 객체의 작업 및 배치 수가 포함된 JSON document를 반환합니다.

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

  • 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 initializes a Bulk() operations builder on the items collection, adds a series of write operations, and calls Bulk.toJSON() on the bulk builder object.

var bulk = db.items.initializeOrderedBulkOp();
bulk.insert( { item: "abc123", status: "A", defaultQty: 500, points: 5 } );
bulk.insert( { item: "ijk123", status: "A", defaultQty: 100, points: 10 } );
bulk.find( { status: "D" } ).deleteOne();
bulk.toJSON();

The Bulk.toJSON() returns the following JSON document

{
acknowledged: true,
insertedCount: 2,
insertedIds: [
{ index: 0, _id: ObjectId("627bf77e5e19ff3518448887") },
{ index: 1, _id: ObjectId("627bf77e5e19ff3518448888") }
],
matchedCount: 0,
modifiedCount: 0,
deletedCount: 0,
upsertedCount: 0,
upsertedIds: []
}
이 페이지 평가하기

이 페이지의 내용