Skip to main content

MongoDB

Experimental
Creates:
AssetsLineage

Configure in the UI

This plugin can be configured directly in the Marmot UI with a step-by-step wizard.

View Guide

The MongoDB plugin discovers databases and collections from MongoDB instances. It samples documents to infer schema and captures index information.

Required Permissions

The user needs read access to discover collections:

db.createUser({
user: "marmot_reader",
pwd: "your-password",
roles: [{ role: "read", db: "your_database" }]
})

For discovering all databases, use the readAnyDatabase role.

Example Configuration


host: "mongo-cluster.company.com"
port: 27017
user: "analytics_reader"
password: "mongo_pass_456"
auth_source: "admin"
tls: true
tags:
- "mongodb"
- "analytics"

Configuration

The following configuration options are available:

PropertyTypeRequiredDescription
auth_sourcestringfalseAuthentication database name
collection_filterplugin.FilterfalseFilter configuration for collections
connection_uristringfalseMongoDB connection URI (overrides host/port/user/password)
database_filterplugin.FilterfalseFilter configuration for databases
exclude_system_dbsboolfalseWhether to exclude system databases (admin, config, local)
external_links[]ExternalLinkfalseExternal links to show on all assets
hoststringfalseMongoDB server hostname or IP address
include_collectionsboolfalseWhether to discover collections
include_databasesboolfalseWhether to discover databases
include_indexesboolfalseWhether to include index information
include_viewsboolfalseWhether to include views
passwordstringfalsePassword for authentication
portintfalseMongoDB server port
sample_schemaboolfalseSample documents to infer schema
sample_sizeintfalseNumber of documents to sample (-1 for entire collection)
tagsTagsConfigfalseTags to apply to discovered assets
tlsboolfalseEnable TLS/SSL for connection
tls_insecureboolfalseSkip verification of server certificate
use_random_samplingboolfalseUse random sampling for schema inference
userstringfalseUsername for authentication

Available Metadata

The following metadata fields are available:

FieldTypeDescription
backgroundboolWhether the index was built in the background
cappedboolWhether the collection is capped
collectionstringCollection name
createdstringCreation timestamp if available
data_types[]stringObserved data types
databasestringDatabase name
descriptionstringField description from validation schema if available
document_countint64Approximate document count
field_namestringField name
fieldsstringFields included in the index
frequencyfloat64Frequency of field occurrence in documents
hoststringMongoDB server hostname
index_countintNumber of indexes on collection
is_requiredboolWhether field appears in all documents
max_documentsint64Maximum document count for capped collections
max_sizeint64Maximum size for capped collections
namestringIndex name
object_typestringObject type (collection, view)
partialboolWhether the index is partial
partial_filterstringFilter expression for partial indexes
portintMongoDB server port
replicatedboolWhether collection is replicated
sample_valuesstringSample values from documents
shard_keystringShard key if collection is sharded
sharding_enabledboolWhether sharding is enabled
sizeint64Collection size in bytes
sparseboolWhether the index is sparse
storage_enginestringStorage engine used
ttlintTime-to-live in seconds if TTL index
typestringIndex type (e.g., single field, compound, text, geo)
uniqueboolWhether the index enforces uniqueness
validation_actionstringValidation action if schema validation is enabled
validation_levelstringValidation level if schema validation is enabled