|
MongoDB\Driver\Manager::executeBulkWriteExecute one or more write operations Beschreibung
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. Parameter-Liste
RückgabewerteReturns MongoDB\Driver\WriteResult on success. Fehler/Exceptions
BeispieleBeispiel #1 MongoDB\Driver\Manager::executeBulkWrite example
<?phpDas oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:
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)
Siehe auch
|