The MongoDB\Driver\WriteResult class
The MongoDB\Driver\WriteResult class encapsulates information about an executed MongoDB\Driver\BulkWrite and may be returned by MongoDB\Driver\Manager::executeBulkWrite.
Intro
The MongoDB\Driver\WriteResult class encapsulates information about an executed MongoDB\Driver\BulkWrite and may be returned by MongoDB\Driver\Manager::executeBulkWrite.
Class synopsis
Properties
insertedCountThe number of documents inserted (excluding upserts), or null if the write concern did not request acknowledgement.
matchedCountThe number of documents matched by update and replace operations, or null if the write concern did not request acknowledgement.
modifiedCountThe number of documents modified by update and replace operations, or null if the write concern did not request acknowledgement or if the server did not report this information.
deletedCountThe number of documents deleted, or null if the write concern did not request acknowledgement.
upsertedCountThe number of documents upserted, or null if the write concern did not request acknowledgement.
serverThe server that executed the bulk write.
upsertedIdsAn array of
_idvalues for upserted documents. Array keys will correspond to the index of the write operation fromMongoDB\Driver\BulkWrite.writeErrorsAn array of
MongoDB\Driver\WriteErrors for any write errors that occurred during execution.writeConcernErrorThe
MongoDB\Driver\WriteConcernErrorthat occurred, or null if no write concern error occurred.writeConcernThe
MongoDB\Driver\WriteConcernused for the bulk write, or null if not available.errorRepliesAn array of error reply documents from the server.
Changelog
| Version | Description |
|---|---|
| PECL mongodb 2.3.0 | Added public readonly properties. |
Writeresult