kmongo / org.litote.kmongo / com.mongodb.client.MongoCollection / count

count

fun <T> MongoCollection<T>.count(filter: String, options: CountOptions = CountOptions()): Long (source)
Deprecated: use countDocuments instead

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

Parameters

filter - the query filter

options - the options describing the count

Return
the number of documents in the collection

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

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

Parameters

clientSession - the client session with which to associate this operation

filter - the query filter

options - the options describing the count

Return
the number of documents in the collection