Count Documents
count_documentsCount documents in a MongoDB collection matching a specified filter, returning the total number of records that meet the query criteria.
Instructions
Count documents in a MongoDB collection that match a filter
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | Query filter as MongoDB Extended JSON, e.g. {"status": "active", "_id": {"$oid": "..."}} | |
| database | No | Optional database to read from for this call only, without changing the active connection | |
| collection | Yes | Collection name |