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=ı).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"collection": "<collection>"
},
"name": "count_documents"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | ||
| database | No | ||
| collation | No | ||
| estimated | No | ||
| collection | Yes | ||
| connection | No |