Skip to content

UpdateResult

interface UpdateResult

The return value of updateMany and updateOne.

Inheritors

Properties

acknowledged

abstract val acknowledged: Boolean

true if the update was acknowledged.

To control whether the update is acknowledged, see UpdateOptions.writeConcern.

If the update was not acknowledged, this property returns false and all properties throw UnsupportedOperationException.

matchedCount

abstract val matchedCount: Long

The number of matched documents.

Throws

UnsupportedOperationException

If the update was not acknowledged.

modifiedCount

abstract val modifiedCount: Long

The number of modified documents.

If this update created new documents (e.g., with upsertOne), they are not counted by this field: they did not already exist, so they were not modified.

Throws

UnsupportedOperationException

If the update was not acknowledged.