fun <T> MongoCollection<T>.countDocuments(filter: String, options: CountOptions = CountOptions()): Long
(source)
Counts the number of documents in the collection according to the given options.
options
- the options describing the count
Return
the number of documents in the collection
fun <T> MongoCollection<T>.countDocuments(clientSession: ClientSession, filter: String, options: CountOptions = CountOptions()): Long
(source)
Counts the number of documents in the collection according to the given options.
clientSession
- the client session with which to associate this operation
options
- the options describing the count
Return
the number of documents in the collection