Connecting MongoDB
Insight O' Mate supports every mainstream way of running MongoDB.
Supported deployments
- MongoDB Atlas — all tiers, including Serverless and Flex.
- Self-hosted replica sets — 4.4 or newer.
- Standalone (single node) — 4.4 or newer. Fine for dev; not recommended for prod.
- Dockerized Mongo — just use the
mongodb://string the container exposes.
Older than 4.4? The app will refuse to connect. Aggregation features we
rely on ($lookup with pipelines, $merge, time-series) aren't available
on 4.2 and below.
Connection strings
Paste the standard SRV or non-SRV form into Settings → Databases:
mongodb+srv://iom-ro:<password>@cluster0.xxxxx.mongodb.net/
or
mongodb://iom-ro:<password>@127.0.0.1:27017/?directConnection=true
The app parses this locally and stores it in the OS keychain. It never leaves the machine.
Read-only roles
Strongly recommended. A read-only role stops an accidental
$merge / $out from mutating your data if a prompt is misinterpreted.
Atlas
In Atlas → Database Access → Add New Database User, give the user the
built-in readAnyDatabase role (or scope it tighter with a custom role on
specific databases).
Self-hosted
use admin
db.createUser({
user: "iom-ro",
pwd: passwordPrompt(),
roles: [{ role: "readAnyDatabase", db: "admin" }]
})
If you want to restrict further to a single DB:
use myapp
db.createUser({
user: "iom-ro",
pwd: passwordPrompt(),
roles: [{ role: "read", db: "myapp" }]
})
What the app fetches
On connect, the app runs exactly these commands:
db.adminCommand({ listDatabases: 1 })— lists databases you can read.db.<name>.listCollections()— names and types only.db.<name>.<coll>.findOne(..., { projection: {_id: 0} })on a single sample doc so we can infer the schema.
That's it. No full table scans, no .find({}).toArray(), no sampling
beyond one document per collection. If you want to see it happen, enable
Settings → Advanced → Log outbound queries and watch the console.
Troubleshooting
"MongoServerSelectionError: connection timed out"
- Atlas users: check your IP access list. The app connects from your
machine, so you need your current IP (or
0.0.0.0/0for dev only). - Self-hosted: is
bindIpset correctly inmongod.conf?
"Authentication failed"
Double-check the user is on the right authSource. For Atlas it's
typically admin; for custom deployments it might be the specific DB.
"Connected, but no collections show up"
The user doesn't have listCollections on that database. Re-check the
role assignment.