4.1.1.14 Creating a Connection to MongoDB
To create a connection to MongoDB:
- On the Catalog page, click Create New Item.
- Hover the mouse over Connection and select MongoDB from the submenu.
- On the Type Properties screen, enter the following details:
- Name: Enter a unique name for the connection. This is a mandatory field.
- Display Name: Enter a display name for the connection. If left blank, the Name field value is copied.
- Description
- Tags
- Connection Type: The selected connection is displayed.
- Click Next.
- On the Connection Details screen, enter the following details:
-
Connection Mode: Select the connection mode from the drop-down list:
- Server Address List:
- Server Address List: Connection to a list of Replicat set members or mongos. This field accepts a comma separated list of
hostnames:port
. For example,localhost1:27017
,localhost2:27018
.-
Authentication Mechanism: Select the authentication mechanism for the connection, from the drop-down list. This is an optional field. Enter the following details for the mechanism you select:
-
Username: Enter the database account user name.
-
Password: Enter the password for your database account.
- Credentials Source: Enter the source of the authentication credentials, typically the database that the credentials have been created in.
- Write Concern: Enter the value in JSON format. Accepted keys are
w
andwtimeout
. For example,{"w": "value" , "wtimeout": "number"}
-
-
- Server Address List: Connection to a list of Replicat set members or mongos. This field accepts a comma separated list of
- Client URI:
- Client URI: Set the client URI in the format:
mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]]
- Authentication Mechanism:
- None: Select this option to disable connection authentication.
- SSL Server Certificate Validation:
- Trust Store File: Upload the truststore file.
- Trust Store Password: Set the truststore password.
- SSL Server/Client Certificate Validation:
- Trust Store File: Upload the truststore file.
- Trust Store Password: Set the truststore password.
- Key Store File: Upload the client certificate, for a two-way SSL communication.
- Key Store Password: Set the keystore password.
- Client URI: Set the client URI in the format:
- Server Address List:
-
- Click Test Connection, to ensure that you have successfully created a connection.
- Click Save.