deleteOne

abstract fun deleteOne(options: ERROR CLASS: Symbol not found for DeleteOneOptions<Document>.() -> Unit = {}, filter: ERROR CLASS: Symbol not found for FilterQuery<Document>.() -> Unit)(source)

Deletes the first document found that matches filter.

Example

class User(
val name: String,
val age: Int
)

collection.deleteOne {
User::name eq "Bob"
}

External resources