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

db. 컬렉션.initializeUnorderedBulkOp() (mongosh 메서드)

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

db.collection.initializeUnorderedBulkOp()

중요

Mongo쉬 방법

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

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

컬렉션에 대한 새 Bulk() 작업 빌더를 초기화하고 반환합니다. 이 빌더는 MongoDB가 일괄적으로 실행하는 쓰기 작업을 순서가 지정되지 않은 목록으로 구성합니다.

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

  • MongoDB Atlas: 클라우드에서의 MongoDB 배포를 위한 완전 관리형 서비스

참고

이 명령은 모든 MongoDB Atlas 클러스터에서 지원됩니다. 모든 명령에 대한 Atlas 지원에 관해 자세히 알아보려면 지원되지 않는 명령을 참조하세요.

순서가 지정되지 않은 작업 목록을 사용하면 MongoDB가 목록에 있는 쓰기 작업을 순서와 상관없이 병행하여 실행할 수 있습니다. 작업 순서가 중요하다면 db.collection.initializeOrderedBulkOp()를 대신 사용하세요.

When executing an unordered list of operations, MongoDB groups the operations. With an unordered bulk operation, the operations in the list may be reordered to increase performance. As such, applications should not depend on the ordering when performing unordered bulk operations.

Bulk() operations in mongosh and comparable methods in the drivers do not have a limit for the number of operations in a group. To see how the operations are grouped for bulk operation execution, call Bulk.getOperations() after the execution.

쓰기 작업 중 하나를 처리하는 동안 오류가 발생하더라도 MongoDB는 목록에 있는 나머지 쓰기 작업을 계속 처리합니다.

다음은 Bulk() 작업 빌더를 초기화하고 여러 문서를 추가하는 일련의 삽입 작업을 추가합니다.

var bulk = db.users.initializeUnorderedBulkOp();
bulk.insert( { user: "abc123", status: "A", points: 0 } );
bulk.insert( { user: "ijk123", status: "A", points: 0 } );
bulk.insert( { user: "mop123", status: "P", points: 0 } );
bulk.execute();
이 페이지 평가하기

이 페이지의 내용