MongoDB\UpdateResult Class

For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt

MongoDB\UpdateResult Class

Definition

This class contains information about an executed update or replace operation. It encapsulates a MongoDB\Driver\WriteResult object and is returned from [MongoDB\Collection::replaceOne()](https://www.mongodb.com/docs/php-library/current/reference/method/mongodbcollection-replaceone.md#mongodb-phpmethod-phpmethod.MongoDB-Collection--replaceOne--, [MongoDB\Collection::updateMany()](https://www.mongodb.com/docs/php-library/current/reference/method/mongodbcollection-updatemany.md#mongodb-phpmethod-phpmethod.MongoDB-Collection--updateMany--, or [MongoDB\Collection::updateOne().](https://www.mongodb.com/docs/php-library/current/reference/method/mongodbcollection-updateone.md#mongodb-phpmethod-phpmethod.MongoDB-Collection--updateOne--

Methods

  • [MongoDB\UpdateResult::getMatchedCount()](https://www.mongodb.com/docs/php-library/current/reference/method/mongodbupdateresult-getmatchedcount.md#mongodb-phpmethod-phpmethod.MongoDB-UpdateResult--getMatchedCount--

  • [MongoDB\UpdateResult::getModifiedCount()](https://www.mongodb.com/docs/php-library/current/reference/method/mongodbupdateresult-getmodifiedcount.md#mongodb-phpmethod-phpmethod.MongoDB-UpdateResult--getModifiedCount--

  • [MongoDB\UpdateResult::getUpsertedCount()](https://www.mongodb.com/docs/php-library/current/reference/method/mongodbupdateresult-getupsertedcount.md#mongodb-phpmethod-phpmethod.MongoDB-UpdateResult--getUpsertedCount--

  • [MongoDB\UpdateResult::getUpsertedId()](https://www.mongodb.com/docs/php-library/current/reference/method/mongodbupdateresult-getupsertedid.md#mongodb-phpmethod-phpmethod.MongoDB-UpdateResult--getUpsertedId--

  • [MongoDB\UpdateResult::isAcknowledged()](https://www.mongodb.com/docs/php-library/current/reference/method/mongodbupdateresult-isacknowledged.md#mongodb-phpmethod-phpmethod.MongoDB-UpdateResult--isAcknowledged--