All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.cedrickring.reactormongodb.collection.kotlin.Helpers.kt Maven / Gradle / Ivy

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