com.github.cedrickring.reactormongodb.collection.kotlin.Helpers.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of reactor-mongodb Show documentation
Show all versions of reactor-mongodb Show documentation
A wrapper above the mongodb-async api with Reactor (http://projectreactor.io/)
The newest version!
package com.github.cedrickring.reactormongodb.collection.kotlin
import com.github.cedrickring.reactormongodb.collection.ReactiveCollection
import com.mongodb.client.model.changestream.ChangeStreamDocument
import org.bson.conversions.Bson
import reactor.core.publisher.Flux
inline fun ReactiveCollection.distinct(fieldName: String, filter: Bson? = null): Flux {
return distinct(fieldName, T::class.java, filter)
}
inline fun ReactiveCollection.findWithType(filter: Bson? = null): Flux {
return this.find(T::class.java, filter)
}
inline fun ReactiveCollection.watchWithType(pipeline: List): Flux> {
return this.watch(pipeline, T::class.java)
}
inline fun ReactiveCollection.mapReduceWithType(mapFunction: String, reduceFunction: String): Flux {
return this.mapReduce(mapFunction, reduceFunction, T::class.java)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy