Connect to MongoDB

To connect to MongoDB, click New connection, choose MongoDB, enter the host and port (27017 by default), a Database, and your username and password. If the user was created in a database other than admin, enter that database in Authentication database. Then click Test connection and Save connection.

DevOpsPad connects to the one host you enter and runs read-only find queries. It does not take a mongodb:// or mongodb+srv:// connection string.

Fields

Field What to enter
Host / Port A mongod or mongos address. The port starts at 27017. No mongodb:// prefix.
Username / Password Leave both empty for a server without authentication. The password is stored in the OS keychain.
Database Required for MongoDB. The database new query tabs use. You can switch databases later in the Explorer.
Authentication database The database where the user was created (authSource). Empty means admin.
Use TLS with certificate verification Turn on for servers that require TLS, including most hosted clusters.

The test sends a ping to the server. If the user’s credentials live in app but you leave Authentication database empty, authentication fails because MongoDB looks for the user in admin.

Choose a database

After you save, select the connection. DevOpsPad lists databases with listDatabases and shows collections for the selected database. Click a collection to open a tab with a starter query:

{
  "collection": "orders",
  "filter": {},
  "limit": 100
}

Each query tab keeps the database it was opened with. Switching the database in the Explorer changes new tabs only. The find queries article covers the query format.

Private clusters

For a database inside a VPC, enable Connect through SSH tunnel and enter the MongoDB host as the SSH server sees it. Name resolution happens on the SSH server. See the SSH tunnel overview.

Limits

  • SRV records (mongodb+srv://) and replica-set connection options are not available yet.
  • Document editing and aggregation pipelines are not available.
  • Custom CA and client certificates are not configurable yet; TLS verifies the server with the system trust store.
  • A user with the built-in read role on the target database is enough. See least-privilege accounts.

Frequently asked questions

What is the authentication database in DevOpsPad?

It is MongoDB's authSource, the database where your user was created. DevOpsPad uses admin when the field is empty.

Can I paste a mongodb+srv connection string?

Not yet. DevOpsPad takes a host and port. SRV records and replica-set connection strings are not supported in this version.