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://.
1
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.2
Allowlist network access
In Atlas, go to Network Access and add the IP addresses that need to
connect so Adapt can reach your cluster.
3
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
1
Open Integrations
In Adapt, go to Settings > Integrations.
2
Find MongoDB
Search for MongoDB and select it from the catalog.
3
Start the connection
Click Connect to open the connection form.
4
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.
5
Test the connection
Ask Adapt to list your collections or query your data.
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