UpdateOperations

Interface grouping MongoDB operations allowing to update existing information.

Inheritors

Types

Link copied to clipboard
interface UpdateResult

The return value of updateMany and updateOne.

Link copied to clipboard

The return value of upsertOne.

Properties

Link copied to clipboard

Functions

Link copied to clipboard
abstract suspend fun bulkWrite(options: BulkWriteOptions<Document>.() -> Unit = {}, filter: FilterQuery<Document>.() -> Unit = {}, operations: BulkWrite<Document>.() -> Unit)

Performs multiple update operations in a single request.

Link copied to clipboard
abstract suspend fun findOneAndUpdate(options: UpdateOptions<Document>.() -> Unit = {}, filter: FilterQuery<Document>.() -> Unit = {}, update: UpdateQuery<Document>.() -> Unit): Document?

Updates one element that matches filter according to update and returns it, atomically.

Link copied to clipboard
abstract suspend fun replaceOne(options: ReplaceOptions<Document>.() -> Unit = {}, filter: FilterQuery<Document>.() -> Unit = {}, document: Document)

Replaces a document that matches filter by document.

Link copied to clipboard
abstract suspend fun repsertOne(options: ReplaceOptions<Document>.() -> Unit = {}, filter: FilterQuery<Document>.() -> Unit = {}, document: Document)

Replaces a document that matches filter by document.

Link copied to clipboard
abstract suspend fun updateMany(options: UpdateOptions<Document>.() -> Unit = {}, filter: FilterQuery<Document>.() -> Unit = {}, update: UpdateQuery<Document>.() -> Unit): UpdateOperations.UpdateResult

Updates all documents that match filter according to update.

Link copied to clipboard
abstract suspend fun updateOne(options: UpdateOptions<Document>.() -> Unit = {}, filter: FilterQuery<Document>.() -> Unit = {}, update: UpdateQuery<Document>.() -> Unit): UpdateOperations.UpdateResult

Updates a single document that matches filter according to update.

Link copied to clipboard
abstract suspend fun upsertOne(options: UpdateOptions<Document>.() -> Unit = {}, filter: FilterQuery<Document>.() -> Unit = {}, update: UpsertQuery<Document>.() -> Unit): UpdateOperations.UpsertResult

Updates a single document that matches filter according to update.