|
MongoDB\Driver\Manager::executeBulkWriteExecute one or more write operations 説明
final public MongoDB\Driver\WriteResult MongoDB\Driver\Manager::executeBulkWrite(string
$namespace , MongoDB\Driver\BulkWrite $bulk , arrayMongoDB\Driver\WriteConcernnull $options = null )Executes one or more write operations on the primary server. A MongoDB\Driver\BulkWrite can be constructed with one or more write operations of varying types (e.g. updates, deletes, and inserts). The driver will attempt to send operations of the same type to the server in as few requests as possible to optimize round trips.
The default value for the パラメータ
戻り値Returns MongoDB\Driver\WriteResult on success. エラー / 例外
変更履歴
例例1 MongoDB\Driver\Manager::executeBulkWrite example
上の例の出力は、 たとえば以下のようになります。 Inserted 3 document(s) Matched 1 document(s) Updated 1 document(s) Upserted 2 document(s) Deleted 1 document(s) upsertedId[3]: object(MongoDB\BSON\ObjectId)#5 (1) { ["oid"]=> string(24) "54d3adc3ce7a792f4d703756" } upsertedId[4]: int(3) 参考
|