Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Docs Menu
Docs Home
/ / /
PHP ライブラリ マニュアル
/ /

MongoDB\ClientBulkWrite::withCollection()

バージョン2.1の新機能

MongoDB\ClientBulkWrite::withCollection()

Return an updated instance of MongoDB\ClientBulkWrite from the provided MongoDB\Collection instance. This method allows you to add subsequent write operations on a different collection than that with which the ClientBulkWrite 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 different Manager objects when calling this method on a ClientBulkWrite instance. This is because the library sends the completed BulkWriteCommand to a single server.

$collection : MongoDB\Collection
The Collection instance to set as the target for write operations added to the ClientBulkWrite instance after calling withCollection().

A new ClientBulkWrite instance with the same BulkWriteCommand specification but an updated target namespace.

MongoDB\Exception\UnsupportedExceptionオプションが使用され、選択したサーバーでサポートされていない場合(例: collationreadConcernwriteConcern )。

MongoDB\Exception\InvalidArgumentException は、パラメータまたはオプションの解析に関連するエラーの場合は です。

MongoDB\Driver\Exception\RuntimeException 拡張レベルのその他のエラー(例:)。

  • 一括書き込み操作ガイドの「クライアント一括書き込み」セクション

戻る

updateOne()

項目一覧