Skip to Content
SourcesMongoDB

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

FieldTypeAlways presentWhat it is
databasestringYesDatabase name
collectionstringYesCollection name
deploymentstringYesATLAS or ON_PREM
document_countintegerNoEstimated 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

FieldTypeRequiredWhat it doesDefault
deployment"ATLAS"Yes
cluster_hoststringYesAtlas 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

FieldTypeRequiredWhat it doesDefault
deployment"ON_PREM"Yes
hoststringYesOn-prem MongoDB host endpoint"localhost"
portintegerYesOn-prem MongoDB TCP port27017

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

FieldTypeRequiredWhat it doesDefault
usernamestringYesMongoDB login username
passwordstringYesMongoDB 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.

FieldTypeRequiredWhat it doesDefault
optionalobjectNono extra properties
connectionobjectNoMongoDB connection and authentication tuning options.no extra properties
connection.app_namestringNoMongoDB appName (Atlas and driver telemetry label)
connection.auth_mechanismenumNoMongoDB authentication mechanism Allowed: DEFAULT, SCRAM-SHA-1, SCRAM-SHA-256, MONGODB-AWS, MONGODB-X509, GSSAPI, PLAIN
connection.auth_sourcestringNoAuthentication database/source (for example, admin)
connection.connect_timeout_msintegerNoMongoDB connection timeout in millisecondsmin 100, max 12000010000
connection.direct_connectionbooleanNoConnect directly to a single host instead of topology discovery
connection.optionsobjectNoAdditional pymongo.MongoClient keyword arguments (advanced usage).{}
connection.replica_setstringNoReplica set name for on-prem deployments
connection.tlsbooleanNoEnable TLS for on-prem connections when required
scopeobjectNoMongoDB database and collection selection scope.no extra properties
scope.collection_limitintegerNoOptional cap on number of collections extracted per databasemin 1
scope.databasestringNoSingle database to scan (optional when include_all_databases is true)
scope.exclude_collectionsarrayNoOptional collection denylist. Accepted forms: collection or database.collection
scope.exclude_collections[]stringNo
scope.exclude_databasesarrayNoDatabase denylist (exact database names)["admin","config","local"]
scope.exclude_databases[]stringNo
scope.include_all_databasesbooleanNoScan all visible databases except excluded system databasestrue
scope.include_collectionsarrayNoOptional collection allowlist. Accepted forms: collection or database.collection
scope.include_collections[]stringNo
scope.include_system_collectionsbooleanNoInclude system.* collections when truefalse
Last updated on