MongoWriteBatch::__construct
(PECL mongo >= 1.5.0)
MongoWriteBatch::__construct — Creates a new batch of write operations
説明
protected MongoWriteBatch::__construct
( MongoCollection $collection
[, string $batch_type
[, array $write_options
]] )
Constructs a new MongoWriteBatch.
注意:
This is a protected constructor. Please use one of the classes inheriting MongoWriteBatch.
パラメータ
collection
バッチを実行する MongoCollection。確認付き書き込み をコピーして、デフォルトとして使います。
$write_options
で指定したり、MongoWriteBatch::execute() で指定したりすることもできます。batch_type
One of:
0
- make an MongoWriteBatch::COMMAND_INSERT batch1
- make an MongoWriteBatch::COMMAND_UPDATE batch2
- make a MongoWriteBatch::COMMAND_DELETE batch
write_options
書き込みオプションの配列。
キー 値 string) WriteConcern の値 wtimeout (int) レプリケーションを待つ時間の最大値 ordered MongoDB にこのバッチを順番どおりに実行させるのかどうかを指定する。順番どおりの書き込みはシリアルに (一度に一行ずつ) 実行され、最初にエラーが発生した時点で実行は中断する。順番どおりでない書き込みはパラレルに実行され、エラーが発生しても処理は中断しない。デフォルトは true
j (bool) プライマリーへのジャーナリングを待つかどうか。これは非推奨なので、かわりに確認付き書き込みを使うこと fsync (bool) プライマリーへの fsync を待つかどうか。これは非推奨なので、かわりに確認付き書き込みを使うこと
返り値
A new MongoWriteBatch of type batch_type
.