count
Retrieve the total number of documents in a MongoDB collection, with an optional query parameter to filter and count specific documents based on defined criteria.
Instructions
Gets the number of documents in a MongoDB collection using db.collection.count() and query as an optional filter parameter
Input Schema
Name | Required | Description | Default |
---|---|---|---|
collection | Yes | Collection name | |
database | Yes | Database name | |
query | No | A filter/query parameter. Allows users to filter the documents to count. Matches the syntax of the filter argument of db.collection.count(). |