Skip to content

Count Documents in Collection (filter in the body)​

POST
/mongodb/collections/{collectionName}/documents/count

Count the Documents of the given Collection that match the filter without loading them

Authorizations​

httpAuth
Type
HTTP (bearer)
or
httpAuth1
Type
HTTP (basic)
or
apiKeyAuth
Type
API Key (header: X-AUTH-APIKEY)

Parameters​

Path Parameters

collectionName*

The name of your MongoDb Collection

Type
string
Required

Query Parameters

q

Full-text search (2.10.0, collections declared with search): the words; the best matches first unless sort is given. 400 for a collection without search.

Type
string
withDeleted

Soft-deleted documents too (collections declared with softDelete, 2.3.0); needs the administrate grant of the collection, 403 otherwise.

Type
boolean
Default
false
drafts

The working copies (2.11.0, collections declared with drafts), also of documents that were never published; needs the write grant (and drafts.readers or the update rule), 403 otherwise.

Type
boolean
Default
false
filterCaseInsensitive

true: wildcards and prefixes of the Lucene filter ignore the case (the behaviour before 2.0.0). By default they are case-sensitive, so an index on the field serves a prefix like name:abc*

Type
boolean
Examplefalse
Default
false

Request Body​

application/json
JSON
{
  
"filter": "string"
}

Responses​

application/json
JSON
{
  
"count": 0
}

Playground​

Authorization
Variables
Key
Value
Body

Samples​

Powered by VitePress OpenAPI

Released under the MIT License.