count
Retrieve the number of documents in a MongoDB collection, with an optional filter to target specific records.
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 |
|---|---|---|---|
| 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(). | |
| database | Yes | Database name | |
| collection | Yes | Collection name |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | Yes | The number of documents in the collection |