MongoDB\ClientBulkWrite::withCollection()
버전 2.1에 추가 되었습니다.
정의
MongoDB\ClientBulkWrite::withCollection()
Return an updated instance of
MongoDB\ClientBulkWrite
from the providedMongoDB\Collection
instance. This method allows you to add subsequent write operations on a different collection than that with which theClientBulkWrite
was created.This method does not build a new BulkWriteCommand and does not edit the
ClientBulkWrite
instance in place.function withCollection( Collection $collection, ): self You cannot mix
Collection
instances associated with differentManager
objects when calling this method on aClientBulkWrite
instance. This is because the library sends the completedBulkWriteCommand
to a single server.
매개변수
$collection
:MongoDB\Collection
- The
Collection
instance to set as the target for write operations added to theClientBulkWrite
instance after callingwithCollection()
.
Return Values
A new ClientBulkWrite
instance with the same BulkWriteCommand
specification but an updated target namespace.
오류/예외
옵션이 사용되지만 선택한 서버에서 지원되지 않는 경우 MongoDB\Exception\UnsupportedException
입니다(예: collation
, readConcern
, writeConcern
).
MongoDB\Exception\InvalidArgumentException
매개변수 또는 옵션의 구문 분석과 관련된 오류의 경우입니다.
MongoDB\ 드라이버\Exception\RuntimeException 확장 수준의 다른 오류(예: 연결 오류).
다음도 참조하세요.
대량 쓰기 작업 가이드 의 클라이언트 대량 쓰기 섹션