kmongo / org.litote.kmongo.coroutine

Package org.litote.kmongo.coroutine

Types

CoroutineAggregatePublisher

Coroutine wrapper around AggregatePublisher.

class CoroutineAggregatePublisher<T : Any> : CoroutinePublisher<T>

CoroutineChangeStreamPublisher

Coroutine wrapper around ChangeStreamPublisher.

class CoroutineChangeStreamPublisher<TResult : Any> : CoroutinePublisher<ChangeStreamDocument<TResult>>

CoroutineClient

A wrapper around MongoClient. Provides coroutine methods for Reactive Streams driver.

class CoroutineClient : Closeable

CoroutineCollection

A wrapper around MongoCollection. Provides coroutine methods for Reactive Streams driver.

class CoroutineCollection<T : Any>

CoroutineDatabase

A wrapper around MongoDatabase. Provides coroutine methods for Reactive Streams driver.

class CoroutineDatabase

CoroutineDistinctPublisher

Coroutine wrapper around CoroutineDistinctPublisher.

class CoroutineDistinctPublisher<T : Any> : CoroutinePublisher<T>

CoroutineFindPublisher

Coroutine wrapper around CoroutineFindPublisher.

class CoroutineFindPublisher<T : Any> : CoroutinePublisher<T>

CoroutineListCollectionsPublisher

Coroutine wrapper around ListCollectionsPublisher.

class CoroutineListCollectionsPublisher<TResult : Any> : CoroutinePublisher<TResult>

CoroutineListIndexesPublisher

Coroutine wrapper around CoroutineListIndexesPublisher.

class CoroutineListIndexesPublisher<T : Any> : CoroutinePublisher<T>

CoroutineMapReducePublisher

Coroutine wrapper around MapReducePublisher.

class CoroutineMapReducePublisher<T : Any> : CoroutinePublisher<T>

CoroutinePublisher

Coroutine wrapper around Publisher.

open class CoroutinePublisher<T : Any>

Extensions for External Classes

com.mongodb.reactivestreams.client.AggregatePublisher

com.mongodb.reactivestreams.client.ChangeStreamPublisher

com.mongodb.reactivestreams.client.ClientSession

com.mongodb.reactivestreams.client.DistinctPublisher

com.mongodb.reactivestreams.client.FindPublisher

com.mongodb.reactivestreams.client.ListCollectionsPublisher

com.mongodb.reactivestreams.client.ListIndexesPublisher

com.mongodb.reactivestreams.client.MapReducePublisher

com.mongodb.reactivestreams.client.MongoClient

com.mongodb.reactivestreams.client.MongoCollection

com.mongodb.reactivestreams.client.MongoDatabase

org.reactivestreams.Publisher

Functions

aggregate

Aggregates documents according to the specified aggregation pipeline. If the pipeline ends with a $out stage, the returned iterable will be a query of the collection that the aggregation was written to. Note that in this case the pipeline will be executed even if the iterable is never iterated.

fun <T : Any> CoroutineCollection<*>.aggregate(vararg pipeline: String): CoroutineAggregatePublisher<T>
fun <T : Any> CoroutineCollection<*>.aggregate(vararg pipeline: Bson): CoroutineAggregatePublisher<T>

bulkWrite

Executes a mix of inserts, updates, replaces, and deletes.

suspend fun <T : Any> CoroutineCollection<T>.bulkWrite(clientSession: ClientSession, vararg requests: String, options: BulkWriteOptions = BulkWriteOptions()): BulkWriteResult
suspend fun <T : Any> CoroutineCollection<T>.bulkWrite(vararg requests: String, options: BulkWriteOptions = BulkWriteOptions()): BulkWriteResult

insertOne

Inserts the provided document. If the document is missing an identifier, the driver should generate one.

suspend fun <T : Any> CoroutineCollection<T>.insertOne(document: String, options: InsertOneOptions = InsertOneOptions()): InsertOneResult
suspend fun <T : Any> CoroutineCollection<T>.insertOne(clientSession: ClientSession, document: String, options: InsertOneOptions = InsertOneOptions()): InsertOneResult

replaceOne

Replace a document in the collection according to the specified arguments.

suspend fun <T : Any> CoroutineCollection<T>.replaceOne(replacement: T, options: ReplaceOptions = ReplaceOptions()): UpdateResult

singleResult

Coroutine wrapper for SingleResultCallback

suspend fun <T : Any> singleResult(callback: (SingleResultCallback<T>) -> Unit): T?

updateOne

Update a single document in the collection according to the specified arguments.

suspend fun <T : Any> CoroutineCollection<T>.updateOne(target: T, options: UpdateOptions = UpdateOptions(), updateOnlyNotNullProperties: Boolean = UpdateConfiguration.updateOnlyNotNullProperties): UpdateResult
suspend fun <T : Any> CoroutineCollection<T>.updateOne(clientSession: ClientSession, target: T, options: UpdateOptions = UpdateOptions(), updateOnlyNotNullProperties: Boolean = UpdateConfiguration.updateOnlyNotNullProperties): UpdateResult?