Skip to content

Commit a6b2d85

Browse files
committed
PHPLIB-102: Implement UpdateResult::getUpsertedCount()
1 parent db628d9 commit a6b2d85

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/UpdateResult.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,19 @@ public function getModifiedCount()
4949
return $this->writeResult->getModifiedCount();
5050
}
5151

52+
/**
53+
* Return the number of documents that were upserted.
54+
*
55+
* This value is undefined if the write was not acknowledged.
56+
*
57+
* @see UpdateResult::isAcknowledged()
58+
* @return integer
59+
*/
60+
public function getUpsertedCount()
61+
{
62+
return $this->writeResult->getUpsertedCount();
63+
}
64+
5265
/**
5366
* Return the ID of the document inserted by an upsert operation.
5467
*

0 commit comments

Comments
 (0)