Skip to content

MongoDB driver for Kotlin (coroutines)opensavvy.ktmongo.coroutines.operationsCollectionOperationsdrop

drop

abstract suspend fun drop(options: <Document>.() -> Unit = {})

Removes an entire collection from the database.

Example

collection.drop()

Using with filtered collections

When using opensavvy.ktmongo.sync.MongoCollection.filter, all elements matching the filter are removed. Other documents are not impacted, and the collection is not deleted.

External resources