MongoDB
Core pluginmarmotdata/mongodb
Discover databases and collections from MongoDB instances
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.
In the UI
Point-and-click, no config file needed.
- 1 Open
Runs→Create Pipeline - 2 Pick MongoDB from the plugin list.
- 3 Fill in the wizard, set a schedule, save.
With the CLI
Save a YAML config, then run marmot ingest.
name: my-mongodb-pipeline
runs:
- mongodb:
host: "<host>"marmot ingest -c ingest.yaml Not using plugins? Other ways to populate Marmot
Configuration
19 top-level fields.
tags multiselect Tags to apply to discovered assets
external_links object[] External links to show on all assets
name string Display name for the link
icon string Icon identifier for the link
url string URL to the external resource
filter object Filter discovered assets by name (regex)
include multiselect Include patterns for resource names (regex)
exclude multiselect Exclude patterns for resource names (regex)
connection_uri string MongoDB connection URI (overrides host/port/user/password)
host string MongoDB server hostname or IP address
port int MongoDB server port
27017 user string Username for authentication
password password Password for authentication
auth_source string Authentication database name
admin tls bool Enable TLS/SSL for connection
false tls_insecure bool Skip verification of server certificate
false include_databases bool Whether to discover databases
true include_collections bool Whether to discover collections
true include_views bool Whether to include views
true include_indexes bool Whether to include index information
true sample_schema bool Sample documents to infer schema
true sample_size int Number of documents to sample (-1 for entire collection)
1000 use_random_sampling bool Use random sampling for schema inference
true exclude_system_dbs bool Whether to exclude system databases (admin, config, local)
true Assets Emitted
Metadata fields this plugin attaches to each discovered asset.
Mongo DB
MongoDBFieldsMongoDBFields represents MongoDB-specific metadata fields
host stringMongoDB server hostname
port intMongoDB server port
database stringDatabase name
collection stringCollection name
object_type stringObject type (collection, view)
size intCollection size in bytes
document_count intApproximate document count
created stringCreation timestamp if available
capped boolWhether the collection is capped
max_size intMaximum size for capped collections
max_documents intMaximum document count for capped collections
storage_engine stringStorage engine used
index_count intNumber of indexes on collection
sharding_enabled boolWhether sharding is enabled
shard_key stringShard key if collection is sharded
replicated boolWhether collection is replicated
validation_level stringValidation level if schema validation is enabled
validation_action stringValidation action if schema validation is enabled
Mongo DB Index
MongoDBIndexFieldsMongoDBIndexFields represents MongoDB index metadata
name stringIndex name
fields stringFields included in the index
unique boolWhether the index enforces uniqueness
sparse boolWhether the index is sparse
background boolWhether the index was built in the background
ttl intTime-to-live in seconds if TTL index
partial boolWhether the index is partial
partial_filter stringFilter expression for partial indexes
type stringIndex type (e.g., single field, compound, text, geo)
Mongo DB Schema
MongoDBSchemaFieldsMongoDBSchemaFields represents MongoDB schema metadata from schema sampling
field_name stringField name
data_types string[]Observed data types
is_required boolWhether field appears in all documents
frequency floatFrequency of field occurrence in documents
sample_values stringSample values from documents
description stringField description from validation schema if available