MongoDB\BulkWriteCommandResult Class
For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt
MongoDB\BulkWriteCommandResult Class
Definition
This class contains information about a completed client bulk write operation. It is returned from [MongoDB\Client::bulkWrite().](https://www.mongodb.com/docs/php-library/current/reference/method/mongodbclient-bulkwrite.md#mongodb-phpmethod-phpmethod.MongoDB-Client--bulkWrite--
Methods
| Method | Description |
|---|---|
getInsertedCount() |
Returns the total number of documents inserted by all insert operations in the bulk write command. |
getMatchedCount() |
Returns the total number of documents matched by all update and replace operations in the bulk write command. |
getModifiedCount() |
Returns the total number of documents modified by all update and replace operations in the bulk write command. |
getUpsertedCount() |
Returns the total number of documents upserted by all update and replace operations in the bulk write command. |
getDeletedCount() |
Return the total number of documents deleted by all delete operations in the bulk write command. |
getInsertResults() |
Returns a map of results of each successful insert operation. Each operation is represented by an integer key, which contains a document with information corresponding to the operation such as the inserted _id value. |
getUpdateResults() |
Returns a map of results of each successful update operation. Each operation is represented by an integer key, which contains a document with information corresponding to the operation. |
getDeleteResults() |
Returns a map of results of each successful delete operation. Each operation is represented by an integer key, which contains a document with information corresponding to the operation. |
isAcknowledged() |
Returns a boolean indicating whether the server acknowledged the bulk operation. |
To learn more about the information returned from the server when you perform a client bulk write operation, see the [Output](https://www.mongodb.com/docs/manual/reference/method/Mongo.bulkWrite/#output section of the Mongo.bulkWrite shell method reference.
See Also
- [Client Bulk Write](https://www.mongodb.com/docs/php-library/current/crud/bulk-write.md#std-label-php-client-bulk-write section of the Bulk Write Operations guide
