ANNOUNCEMENT: Voyage AI joins MongoDB to power more accurate and trustworthy AI applications on Atlas.
Learn more
Docs 菜单

MongoDB\BulkWriteResult::getUpsertedCount()

MongoDB\BulkWriteResult::getUpsertedCount()

Return the total number of documents that were upserted by all update and replace operations in the bulk write.

function getUpsertedCount(): integer

仅当写入已确认时才应调用此方法。

The total number of documents that were upserted by all update and replace operations in the bulk write.

MongoDB\Exception\BadMethodCallException如果调用此方法并且写入操作使用了未确认的写关注。