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

countDocuments

fun <T> MongoCollection<T>.countDocuments(): Single<Long> (source)

Counts the number of documents

Return
count of all collection

fun <T> MongoCollection<T>.countDocuments(clientSession: ClientSession): Single<Long> (source)

Counts the number of documents

Parameters

clientSession - the client session

Return
count of all collection

fun <T> MongoCollection<T>.countDocuments(filter: String, options: CountOptions = CountOptions()): Single<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()): Single<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