Docs Menu
Docs Home
/ / /
PHP 라이브러리 매뉴얼
/ /

MongoDB\ClientBulkWrite::withCollection()

버전 2.1에 추가 되었습니다.

MongoDB\ClientBulkWrite::withCollection()

제공된 인스턴스 에서 의 업데이트된 인스턴스 MongoDB\ClientBulkWrite MongoDB\Collection 반환합니다. 이 메서드를 사용하면 생성 시 사용된 컬렉션이 아닌 다른 컬렉션 에 후속 쓰기 (write) 작업을 추가할 수 ClientBulkWrite 있습니다.

메서드는 새 BulkWriteCommand 를 빌드 하지 않으며 인스턴스 현재 ClientBulkWrite 위치에서 편집하지 않습니다.

function withCollection(
Collection $collection,
): self

ClientBulkWrite 인스턴스 에서 이 메서드를 호출할 때 다른 Manager 객체와 연결된 Collection 인스턴스를 혼합할 수 없습니다. 이는 라이브러리가 완료된 BulkWriteCommand 을 단일 서버 로 전송하기 때문입니다.

$collection : MongoDB\Collection
withCollection()를 호출한 후 ClientBulkWrite 인스턴스 에 추가된 쓰기 (write) 작업의 대상으로 설정하다 Collection 인스턴스 입니다.

BulkWriteCommand 사양은 동일하지만 대상 네임스페이스 업데이트된 새 ClientBulkWrite 인스턴스 입니다.

옵션이 사용되지만 선택한 서버에서 지원되지 않는 경우 MongoDB\Exception\UnsupportedException입니다(예: collation, readConcern, writeConcern).

MongoDB\Exception\InvalidArgumentException 매개변수 또는 옵션의 구문 분석과 관련된 오류의 경우입니다.

MongoDB\ 드라이버\Exception\RuntimeException 확장 수준의 다른 오류(예: 연결 오류).

  • 대량 쓰기 작업 가이드 의 클라이언트 대량 쓰기 섹션

돌아가기

updateOne()

이 페이지의 내용