count

suspend fun MongoCollection<*>.count(filter: BsonDocument? = null, limit: Long? = null): Long

Returns the number of documents in the collection.

Parameters

filter

a filter to select specific documents. If null then no filtering will be done.

limit

an upper bound of the number of documents to consider. If null then no limit is applied.

Throws

if the underlying App Service HTTP requests fails.