|
MongoDB\Driver\Manager::executeBulkWriteExecute one or more write operations Description
final public MongoDB\Driver\WriteResult MongoDB\Driver\Manager::executeBulkWrite
( string
$namespace
, MongoDB\Driver\BulkWrite $bulk
[, MongoDB\Driver\WriteConcern $writeConcern
] )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. Parameters
Return ValuesReturns MongoDB\Driver\WriteResult on success. Errors/Exceptions
ExamplesExample #1 MongoDB\Driver\Manager::executeBulkWrite example
<?php The above example will output something similar to: 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) See Also
|