List Distinct Values
distinct_valuesRetrieve distinct values for a field in a MongoDB collection, optionally filtered by a query, to identify unique entries for analysis.
Instructions
List the distinct values of a field in a MongoDB collection, optionally within a filter
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| field | Yes | Field path, e.g. status or address.city | |
| 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 |