kmongo / org.litote.kmongo.reactivestreams / com.mongodb.reactivestreams.client.MongoDatabase

Extensions for com.mongodb.reactivestreams.client.MongoDatabase

getCollection

Gets a collection.

fun <T : Any> MongoDatabase.getCollection(): MongoCollection<T>

getCollectionOfName

Gets a collection.

fun <T : Any> MongoDatabase.getCollectionOfName(collectionName: String): MongoCollection<T>

runCommand

Executes the given command in the context of the current database with the given read preference.

fun <TResult : Any> MongoDatabase.runCommand(command: String, readPreference: ReadPreference): Publisher<TResult>
fun <TResult : Any> MongoDatabase.runCommand(command: String): Publisher<TResult>

withKMongo

Returns a MongoDatabase with a KMongo codec.

fun MongoDatabase.withKMongo(): MongoDatabase