Skip to main content
Feedback

MongoDB Atlas connection

Creating MongoDB Atlas connection

Procedure

Step 1 - Whitelist Data Integration IP's in your Mongo instance

  1. In your MongoDB Atlas account, Go to Network Access and click Add IP Adresses.
  2. Whitelist the following IPs in your Mongo instance.

atlas_11.png

After Whitelisting the IP addresses, the result is shown: atlas_10.png

Connecting to Mongo Atlas using private endpoint (Optional)

info

Using Private Endpoint for connecting to Mongo Atlas is accessible to users on the Enterprise plan.

  1. Under Database Network, choose Private Endpoint and click on Add Private Endpoint.

  2. On Cloud Provider, Choose AWS and click Next.

  3. Choose Region. Data Integration supports PrivateLink in the next regions:

    On console.rivery.io:

    • us-east-1
    • us-east-2
    • us-west-2

    On eu-west-1.console.rivery.io: eu-west-1

    On il-central-1.console.rivery.io: il-central-1

    On ap-southeast-2.console.rivery.io: ap-southeast-2

    Wait for a while until the endpoint is available, and a green v is displayed.

  4. Copy the command, and get the --service-name value.

  5. Provide the service-name to your Data Integration Account Manager or to the Support team. Data Integration internally connects with your Mongo Atlas Private Endpoint, and provides you a VPC-Endpoint-ID in the format: vpce-XXXXXXXXXXXXXXX

  6. Paste the VPC Endpoint ID in the right place and click on Create.

Step 2 - Retrieving a connection string

  1. In your MongoDB Atlas account, go to Databases, choose your database and click Connect.
  2. If Private Endpoint was created on Step 1, choose Private Endpoint as the connection method, and also choose the Private Endpoint you have created.
  3. Select Connect your application.
  4. Copy the URL shown on the page, and paste it. And change the <username> and <password> to {username} and {password}, and change the MyFirstDatabase to the database name you want to connect to.
info

Formatting MongoDB Connection Strings Correctly. When connecting to MongoDB Atlas clusters, ensure the connection string includes the +srv prefix. This prefix enables the use of DNS SRV records for cluster discovery and connection configuration.

  • Incorrect:
mongodb://shilohrajk:hxbTHdLfPZKAVR2v@cluster0.ksugj.mongodb.net:27017/sample_mflix
  • Correct:
mongodb+srv://shilohrajk:hxbTHdLfPZKAVR2v@cluster0.ksugj.mongodb.net/sample_mflix

Using the +srv format prevents DNS-related and authentication issues, ensuring a reliable connection to your MongoDB Atlas cluster.

Step 3 - Setting up the Connection at the Data Integration console

  1. Provide a Connection Name.
  2. Configure the Host, Port (default: 27017), and Database.
note

The database name must be in lowercase.

  1. Enter your Username and Password.
  2. Specify your URI.
  3. Click Test Connection to verify your credentials.
  4. Save your connection by clicking Save.
On this Page