Reference
Connecting your MongoDB
Run an Enterprise service on your own MongoDB, on Atlas or self-hosted: the connection string, the network settings to open, and where the service keeps its data.
An Enterprise service can run on a MongoDB you own, on MongoDB Atlas or anywhere else, and your data stays there. The service needs the connection string before it can start.
On Free, Starter and Pro, MongoDB is included and there is nothing to do.
What you need
-
A MongoDB 6.0 or later, reachable from the internet over TLS. Atlas on AWS, GCP or Azure, any tier; a server of yours; or a compatible service that speaks the MongoDB protocol.
-
A database user for the service with
readWriteon your database andreadonadmin. Create a user for this purpose only. -
The connection string:
mongodb+srv://<user>:<password>@<host>/<database>?retryWrites=true&w=majority
A password with special characters must be URL-encoded. Without SRV, use mongodb://<user>:<password>@<host>:<port>/<database>?tls=true&retryWrites=true.
Open the network
The service connects from fixed IP addresses. Add them to your MongoDB’s network access list, in Atlas under Network Access. Ask support from the console for the current addresses of your region.
TLS is required: Atlas has it on by default; on a server of yours, set net.tls.mode: requireTLS. Port 27017, or your own, must be open to those addresses.
Give it to the service
When you create a service and choose Enterprise, the console opens a form to our team. We set the service up with you, and you give us the connection string. The service checks that it can reach the database and sign in before it starts. If the check fails, look at the string, the network access list, the user’s rights and TLS, in that order.
To change the string later, for a rotated password or a new cluster, open a ticket from the service’s Support page. The service reconnects; its address does not change.
Where the service keeps its own data
The service stores its users, permissions and GraphQL apps in a database called restheart inside your MongoDB, and its schemas in the schemas collection of each database:
| Collection | Path on Enterprise |
|---|---|
Users |
|
Permissions |
|
GraphQL apps |
|
Schemas |
|
Keep your own collections out of the restheart database. The console uses these paths for you; your scripts must use them too. See what differs between plans.
Related pages
-
Plans: everything else that changes on Enterprise.
-
Getting started: the first steps once the service is up.