count_documents
Counts MongoDB documents matching a filter, with optional estimated metadata totals or collation for locale-aware matching.
Instructions
Count documents matching a filter. estimated=true uses collection metadata (fast, ignores the filter). collation: {"locale": "tr", "strength": 2} for Turkish case-insensitive matching (İ=i, I=ı).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | ||
| database | No | ||
| collation | No | ||
| estimated | No | ||
| collection | Yes | ||
| connection | No |