MongoDB
MongoDB
Scan MongoDB collections for Atlas or on-prem deployments.
- Category
- Databases
- Source type
- MONGODB
- Produces
- collection
MongoDB’s flexibility is exactly why it’s worth scanning: documents in the same collection can have completely different shapes, and a field nobody declared can quietly start carrying personal data.
What you need to connect
Either an Atlas cluster host or an on-premises host and port, plus a
username and password (or no credentials for an unauthenticated deployment).
read on the databases you want scanned is enough.
Advanced options cover the rest of the real world: authentication mechanism and source database, replica set, TLS, direct connection, and any additional driver arguments.
What Classifyre reads
One asset per collection, whose content is a sample of real documents. Because the sample is of documents rather than a declared schema, fields that only appear in some documents are still seen.
Scope by database and by collection, with allow- and denylists, a per-database collection cap, and a switch for system collections.
Metadata on every asset
Asset kind · collection
| Field | Type | Always present | What it is |
|---|---|---|---|
| database | string | Yes | Database name |
| collection | string | Yes | Collection name |
| deployment | string | Yes | ATLAS or ON_PREM |
| document_count | integer | No | Estimated number of documents in the collection |
Lineage
Lineage
This source records no lineage. Nothing in the system it reads describes data moving from one place to another, so no FLOW edges are produced. Related items are still linked — see Lineage & Relationships for what those links mean and how they differ from lineage.
Worth knowing
- Reads are non-blocking. Only find and count operations are issued; nothing is written and no index is built.
- A secondary replica is a fine target if you’d rather keep the scan off the primary.
Configuration
Beyond the fields below, every source also has the settings shared by all of them: the sampling strategy, the detectors to run, the scan schedule, and the compute limits for its scan jobs.
Required
Without these, the source will not save.
This section depends on which authentication method you pick — one of the following applies.
MongoDB Atlas
| Field | Type | Required | What it does | Default |
|---|---|---|---|---|
| deployment | "ATLAS" | Yes | — | — |
| cluster_host | string | Yes | Atlas SRV cluster host or full mongodb+srv:// URI (for example, cluster.abc123.mongodb.net or mongodb+srv://cluster.abc123.mongodb.net). If a full URI is supplied, the host is extracted and credentials are discarded — set them in masked fields instead. | — |
MongoDB On Prem
| Field | Type | Required | What it does | Default |
|---|---|---|---|---|
| deployment | "ON_PREM" | Yes | — | — |
| host | string | Yes | On-prem MongoDB host endpoint | "localhost" |
| port | integer | Yes | On-prem MongoDB TCP port | 27017 |
Secrets
Stored encrypted and never shown again after you save them. See Configuration & Fields.
This section depends on which authentication method you pick — one of the following applies.
MongoDB Username Password
| Field | Type | Required | What it does | Default |
|---|---|---|---|---|
| username | string | Yes | MongoDB login username | — |
| password | string | Yes | MongoDB login password | — |
MongoDB No Authentication
Secret fields · MongoDB No Authentication: none for this source.
Optional
Everything you can tune. Sensible defaults apply when you leave them alone.
| Field | Type | Required | What it does | Default |
|---|---|---|---|---|
| optional | object | No | —no extra properties | — |
| connection | object | No | MongoDB connection and authentication tuning options.no extra properties | — |
| connection.app_name | string | No | MongoDB appName (Atlas and driver telemetry label) | — |
| connection.auth_mechanism | enum | No | MongoDB authentication mechanism Allowed: DEFAULT, SCRAM-SHA-1, SCRAM-SHA-256, MONGODB-AWS, MONGODB-X509, GSSAPI, PLAIN | — |
| connection.auth_source | string | No | Authentication database/source (for example, admin) | — |
| connection.connect_timeout_ms | integer | No | MongoDB connection timeout in millisecondsmin 100, max 120000 | 10000 |
| connection.direct_connection | boolean | No | Connect directly to a single host instead of topology discovery | — |
| connection.options | object | No | Additional pymongo.MongoClient keyword arguments (advanced usage). | {} |
| connection.replica_set | string | No | Replica set name for on-prem deployments | — |
| connection.tls | boolean | No | Enable TLS for on-prem connections when required | — |
| scope | object | No | MongoDB database and collection selection scope.no extra properties | — |
| scope.collection_limit | integer | No | Optional cap on number of collections extracted per databasemin 1 | — |
| scope.database | string | No | Single database to scan (optional when include_all_databases is true) | — |
| scope.exclude_collections | array | No | Optional collection denylist. Accepted forms: collection or database.collection | — |
| scope.exclude_collections[] | string | No | — | — |
| scope.exclude_databases | array | No | Database denylist (exact database names) | ["admin","config","local"] |
| scope.exclude_databases[] | string | No | — | — |
| scope.include_all_databases | boolean | No | Scan all visible databases except excluded system databases | true |
| scope.include_collections | array | No | Optional collection allowlist. Accepted forms: collection or database.collection | — |
| scope.include_collections[] | string | No | — | — |
| scope.include_system_collections | boolean | No | Include system.* collections when true | false |