count
Count documents in a MongoDB collection using optional query filters. Specify the database and collection to retrieve the total or filtered document count.
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(). |