kmongo / org.litote.kmongo.reactor / com.mongodb.reactivestreams.client.MongoCollection / countDocuments

countDocuments

fun <T> MongoCollection<T>.countDocuments(filter: String, options: CountOptions = CountOptions()): Mono<Long> (source)

Counts the number of documents in the collection according to the given options.

Parameters

filter - the query filter

Return
count of filtered collection

fun <T> MongoCollection<T>.countDocuments(clientSession: ClientSession, filter: String, options: CountOptions = CountOptions()): Mono<Long> (source)

Counts the number of documents in the collection according to the given options.

Parameters

clientSession - the client session

filter - the query filter

Return
count of filtered collection