Articles in this section

Set up a connection to MongoDB

MongoDB links: API guide , Authentication

A. Select application to connect to

  1. In the left pane, select Resources→Connections. Then, click + Create connection at the top right of the page.

  2. On the Create connection page, in the Application search box, enter the first few letters of the database application that you want to connect to.

    create-connection-dbapplication-search.png

    For example, enter mon in the search box, and from the resulting application list, click MongoDB.

Tip

You can also create a connection to an application while configuring a new export to retrieve data from the application or a new import to insert data into the application.

B. Enter general info for application connection

create-connection-general.png

MongoDB connection setting

Value

Name

Be sure to provide a clear and distinguishable. Throughout integrator.io imports and exports, you will have the option to choose this new connection, and a unique identifier will prove helpful later when selecting among a list of connections that you’ve created.

Application (read only)

Shows the database application that you had earlier selected to create a connection.

Mode

Select a Cloud (remote) or On-premise (network) server; for On-premise, there’s an additional step to specify an Agent.

Agent: Select an agent from the list of agents in your account. To connect to an on-premise application, integrator.io requires that an agent be installed on a networked computer. An agent is a small application that allows you to connect to data behind your firewall. When installing an agent, you will specify a unique access token, which then populates the Agent drop-down list. The installed agents connect to integrator.io and establish a reverse SSH tunnel, allowing secure communication without the need to whitelist integrator.io’s IP addresses in your firewall settings. A single agent can be used by multiple different connections.

B. Enter application details to authenticate connection

Before you enter authentication details, see Configure MongoDB and retrieve values from connection string.

create-connection-application-details.png

MongoDB connection setting

Value

Host(s):

Note

MongoDB supports the following 2 connection string formats, which includes the host as a part of it, to connect to its database instances:

  • the standard connection string format that is prefixed by mongodb://

  • the DNS seedlist connection format that is prefixed by mongodb+srv://

Currently, Celigo supports only the standard connection string format (mongodb://). So, if you enter a host that is part of the DNS seedlist connection format, then you might encounter a DNS lookup error when you test the connection.

We plan to support the DNS seedlist connection format (mongodb+srv://) in a future release.

Enter the hostname or IP address for your MongoDB instance – for example: mongodb-instance1.com or 172.16.254.1.

By default, integrator.io will connect to port 27017. If you need to connect to a different port, then append :port to your hostname – for example: mongodb-instance1.com:12345 or 172.16.254.1:98765.

If you are connecting to a MongoDB cluster, then list all hostname:port combinations, separated by commas – for example: mongodb-instance1.com:12345,mongodb-instance2.com:12345,mongodb-instance3.com:12345.

Database

Enter the name of the database you would like to connect to. If left blank, the “admin” database will be queried.

Username

Enter the username for the account set up by the MongoDB server administrator.

Password

Enter the password for this account, if required.

Configure MongoDB and retrieve values from connection string

The following example reviews a MongoDB Atlas installation. First, click the Connect button on your cluster:

19336042648859-mongodb-connect-1b.png

In the resulting Connect to... menu, click Connect your application.

19336024904859-mongodb-connect-2b.png

Under Choose your driver version, select the following settings:

  • Driver: Node.js

  • Version: 2.2.12 or later

Important

Do not set Version to MongoDB 3.0+.

19336024905371-mongodb-connect-3b.png

Before closing this dialog, under Connection string only click the Copy button. Then, paste the contents into a text editor. For example:

mongodb://mongodb-server : <password> @ mongodb-adaptor-server-00-00-5xtno.mongodb.net:27017,mongodb-adaptor-server-00-01-5xtno.mongodb.net:27017 / test ? ssl=true &replicaSet= mongodb-adaptor-server &authSource= admin&retryWrites=true&w=majority

The properties we need from this string are derived as follows:

Connection field

Connection string

Sample value

Host(s)

mongodb-adaptor-server-00-00-5xtno.mongodb.net:27017,mongodb-adaptor-server-00-01-5xtno.mongodb.net:27017

mongodb-adaptor-server-00-00-5xtno.mongodb.net:27017,mongodb-adaptor-server-00-01-5xtno.mongodb.net:27017

Database name

test

test

Username

mongodb-server

mongodb-server

Password

<password>

<password>

Replica set

mongodb-adaptor-server

mongodb-adaptor-server

TLS/SSL

ssl=true

[Check the box]

Auth source

admin

admin

D. Enter advanced details for application connection

Continuing in the Create connection pane, only if required, enter additional configuration information for the MongoDB server.

create-connection-advanced.png

MongoDB connection setting

Value

Replica set (optional)

Enter the name of the replica set. The replica set members must be supplied in the Host(s) field, above.

TLS/SSL (optional)

Check this box to enable TLS/SSL security for the connection.

Auth source (optional)

Enter the name of the database associated with the user’s credentials. If you do not specify an Auth source database, then the Database field above will be used as the default.

E. Test and save application connection

Once you have configured the MongoDB connection, you have a few options for continuing:

create-connection-form-buttons.png
  • Test connection – click this button to verify that your new connection is free of errors

  • Save and close – click this button to save the connection, commit the new connection so that it will be available to all integrations for your account (and applied to the current source or destination app, if you created it within a flow)

  • Save - click this button to save the connection

  • Close – click this link to exit connection creation without saving

Read more about this connector: