Set up credentials
Adapt connects to MongoDB using a connection string (URI). MongoDB Atlas uses themongodb+srv:// format, and self-hosted deployments typically use
mongodb://.
Create a read-only database user (recommended)
In MongoDB Atlas, go to Database Access and add a database user with a
read-only role (for example
readAnyDatabase, or read on a specific
database) rather than an admin account. Note the username and password.Allowlist network access
In Atlas, go to Network Access and add the IP addresses that need to
connect so Adapt can reach your cluster.
Copy your connection string
In Atlas, go to Database > Clusters, click Connect, choose
Drivers, and copy the connection string. It looks like:Replace
<username> and <password> with your database user’s credentials.
For self-hosted deployments, use your mongodb://host:27017/... URI. Any
special characters in the password must be percent-encoded.The
mongodb+srv:// format resolves your cluster’s hosts automatically. Use the
plain mongodb:// format for standalone or self-managed servers.Connect to Adapt
Add your credentials
Enter the values you gathered above, then click Add connection:
You can rename the connection and choose whether it is shared with your
organization or kept personal to you.
| Secret Name | Value |
|---|---|
MONGODB_URI | Your MongoDB connection string |
Security
- Credentials are encrypted at rest with AES-256
- Use a dedicated database user with a read-only role
- Restrict network access with an IP access list and allowlist only trusted addresses
- Connect over TLS, which is enabled by default for Atlas
mongodb+srv://connections - Never share your connection string publicly or commit it to source control