Skip to content

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

MongoCollection

Properties

context

abstract val context: ERROR CLASS: Symbol not found for BsonContext

Functions

aggregate

Start an aggregation pipeline.

bulkWrite

abstract suspend fun bulkWrite(options: ERROR CLASS: Symbol not found for BulkWriteOptions.() -> Unit, filter: ERROR CLASS: Symbol not found for FilterQuery.() -> Unit, operations: ERROR CLASS: Symbol not found for BulkWrite.() -> Unit)

Performs multiple update operations in a single request.

count

abstract suspend fun count(): Long

Counts how many documents exist in the collection.

abstract suspend fun count(options: ERROR CLASS: Symbol not found for CountOptions.() -> Unit, predicate: ERROR CLASS: Symbol not found for FilterQuery.() -> Unit): Long

Counts how many documents match predicate in the collection.

countEstimated

abstract suspend fun countEstimated(): Long

Counts all documents in the collection.

deleteMany

abstract suspend fun deleteMany(options: ERROR CLASS: Symbol not found for DeleteManyOptions.() -> Unit, filter: ERROR CLASS: Symbol not found for FilterQuery.() -> Unit)

Deletes all documents that match filter.

deleteOne

abstract suspend fun deleteOne(options: ERROR CLASS: Symbol not found for DeleteOneOptions.() -> Unit, filter: ERROR CLASS: Symbol not found for FilterQuery.() -> Unit)

Deletes the first document found that matches filter.

drop

abstract suspend fun drop(options: ERROR CLASS: Symbol not found for DropOptions.() -> Unit)

Removes an entire collection from the database.

filter

fun <Document : Any> MongoCollection<Document>.filter(filter: ERROR CLASS: Symbol not found for FilterQuery.() -> Unit): MongoCollection<Document>

Returns a filtered collection that only contains the elements that match filter.

find

abstract fun find(): MongoIterable<Document>

Finds all documents in this collection.

abstract fun find(options: ERROR CLASS: Symbol not found for FindOptions.() -> Unit, filter: ERROR CLASS: Symbol not found for FilterQuery.() -> Unit): MongoIterable<Document>

Finds all documents in this collection that satisfy filter.

findOne

open suspend fun findOne(options: ERROR CLASS: Symbol not found for FindOptions.() -> Unit, filter: ERROR CLASS: Symbol not found for FilterQuery.() -> Unit): Document?

Finds a document in this collection that satisfies filter.

findOneAndUpdate

abstract suspend fun findOneAndUpdate(options: ERROR CLASS: Symbol not found for UpdateOptions.() -> Unit, filter: ERROR CLASS: Symbol not found for FilterQuery.() -> Unit, update: ERROR CLASS: Symbol not found for UpdateQuery.() -> Unit): Document?

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

insertMany

open suspend fun insertMany(vararg documents: Document, options: ERROR CLASS: Symbol not found for InsertManyOptions.() -> Unit)

Inserts multiple documents in a single operation.

abstract suspend fun insertMany(documents: Iterable<Document>, options: ERROR CLASS: Symbol not found for InsertManyOptions.() -> Unit)

Inserts multiple documents in a single operation.

insertOne

abstract suspend fun insertOne(document: Document, options: ERROR CLASS: Symbol not found for InsertOneOptions.() -> Unit)

Inserts a document.

replaceOne

abstract suspend fun replaceOne(options: ERROR CLASS: Symbol not found for ReplaceOptions.() -> Unit, filter: ERROR CLASS: Symbol not found for FilterQuery.() -> Unit, document: Document)

Replaces a document that matches filter by document.

repsertOne

abstract suspend fun repsertOne(options: ERROR CLASS: Symbol not found for ReplaceOptions.() -> Unit, filter: ERROR CLASS: Symbol not found for FilterQuery.() -> Unit, document: Document)

Replaces a document that matches filter by document.

updateMany

abstract suspend fun updateMany(options: ERROR CLASS: Symbol not found for UpdateOptions.() -> Unit, filter: ERROR CLASS: Symbol not found for FilterQuery.() -> Unit, update: ERROR CLASS: Symbol not found for UpdateQuery.() -> Unit)

Updates all documents that match filter according to update.

updateManyWithPipeline

abstract suspend fun updateManyWithPipeline(options: ERROR CLASS: Symbol not found for UpdateOptions.() -> Unit, filter: ERROR CLASS: Symbol not found for FilterQuery.() -> Unit, update: ERROR CLASS: Symbol not found for UpdateWithPipelineQuery.() -> Unit)

Updates all documents that match filter according to the update pipeline.

updateOne

abstract suspend fun updateOne(options: ERROR CLASS: Symbol not found for UpdateOptions.() -> Unit, filter: ERROR CLASS: Symbol not found for FilterQuery.() -> Unit, update: ERROR CLASS: Symbol not found for UpdateQuery.() -> Unit)

Updates a single document that matches filter according to update.

updateOneWithPipeline

abstract suspend fun updateOneWithPipeline(options: ERROR CLASS: Symbol not found for UpdateOptions.() -> Unit, filter: ERROR CLASS: Symbol not found for FilterQuery.() -> Unit, update: ERROR CLASS: Symbol not found for UpdateWithPipelineQuery.() -> Unit)

Updates a single document that matches filter according to the update pipeline.

upsertOne

abstract suspend fun upsertOne(options: ERROR CLASS: Symbol not found for UpdateOptions.() -> Unit, filter: ERROR CLASS: Symbol not found for FilterQuery.() -> Unit, update: ERROR CLASS: Symbol not found for UpsertQuery.() -> Unit)

Updates a single document that matches filter according to update.

upsertOneWithPipeline

abstract suspend fun upsertOneWithPipeline(options: ERROR CLASS: Symbol not found for UpdateOptions.() -> Unit, filter: ERROR CLASS: Symbol not found for FilterQuery.() -> Unit, update: ERROR CLASS: Symbol not found for UpdateWithPipelineQuery.() -> Unit)

Updates a single document that matches filter according to the update pipeline.