Skip to content

CollectionOperations

Interface grouping MongoDB operations relating to collection administration.

Inheritors

Properties

context

The full BSON configuration, used by the DSL to generate queries.

For more information, see BsonContext.

Functions

drop

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

Removes an entire collection from the database.

All documents within the collection are deleted.

Indexes attached to this collection are also deleted.

Example

collection.drop()

External resources