MongoDB

Version 25.3.9396


MongoDB


You can use the MongoDB connector from the CData Sync application to capture data from MongoDB and move it to any supported destination. To do so, you need to add the connector, authenticate to the connector, and complete your connection.

Add the MongoDB Connector

To enable Sync to use data from MongoDB, you first must add the connector, as follows:

  1. Open the Connections page of the Sync dashboard.

  2. Click Add Connection to open the Select Connectors page.

  3. Click the Sources tab and locate the MongoDB row.

  4. Click the Configure Connection icon at the end of that row to open the New Connection page. If the Configure Connection icon is not available, click the Download Connector icon to install the MongoDB connector. For more information about installing new connectors, see Connections.

Authenticate to MongoDB

After you add the connector, you need to set the required properties.

  • Connection Name - Enter a connection name of your choice.

  • Server - Enter the name or address of the server on which your MongoDB instance runs. The default server is localhost.

  • Port - Enter the port for the MongoDB database. The default port value is 27017.

CData Sync supports authenticating to MongoDB in several ways. Select your authentication method below to proceed to the relevant section that contains the authentication details.

MongoDB Challenge Response

To connect with a MongoDB challenge response (CR), specify the following properties:

  • Auth Scheme - Select MongoDB-CR.

  • User - Enter the username that you use to authenticate to the MongoDB account.

  • Password - Enter the password that you use to authenticate to the MongoDB account.

SCRAM SHA-1

To connect with the SCRAM SHA-1 credentials, specify these properties:

  • Auth Scheme - Select SCRAM-SHA-1.

  • User - Enter the username that you use to authenticate to the MongoDB account.

  • Password - Enter the password that you use to authenticate to the MongoDB account.

SCRAM SHA-256

To connect with the SCRAM SHA-256 credentials, specify these properties:

  • Auth Scheme - Select SCRAM-SHA-256.

  • User - Enter the username that you use to authenticate to the MongoDB account.

  • Password - Enter the password that you use to authenticate to the MongoDB account.

Plain

To connect with a plain-text login, specify these properties:

  • Auth Scheme - Select Plain.

  • User - Enter the username that you use to authenticate to your MongoDB account.

  • Password - Enter the password that you use to authenticate to your MongoDB account.

Generic Security Services API

To connect with Kerberos credentials, specify these properties:

  • Auth Scheme - Select GSSAPI.

  • Kerberos KDC - Enter the this to the host name or IP Address of your Kerberos Key Distribution Center (KDC) machine.

  • Kerberos Realm - Enter the Kerberos realm that you use to authenticate to Kerberos.

  • Kerberos SPN - Enter the service principal name (SPN) for the Kerberos domain controller.

  • Kerberos User - Enter the principal name for the Kerberos domain controller. They syntax for this name is Host/User@realm.

  • Kerberos Keytab File (optional) - Enter the full file path to your Kerberos keytab file.

  • Kerberos Ticket Cache (optional) - Enter the full file path to an MIT Kerberos credential cache file.

X.509 Certificate

To connect with X.509 certificate authentication, specify these properties:

  • Auth Scheme - Select X509.

  • User - Enter the username that you use to authenticate to the MongoDB account.

  • Password - Enter the password that you use to authenticate to the MongoDB account.

None

To connect without authentication, select None for Auth Scheme. No additional properties are required.

Complete Your Connection

To complete your connection:

  1. Specify the following properties:

    • (Optional) Database - Enter the name of the MongoDB database that you want to read from and write to.

      Note: To connect to data from one database and authenticate to another database, you need to set both Database and Auth Database.

    • (Optional) Auth Database - Enter the name of the MongoDB database that you want to use for authentication. (See note above for when to specify this property.)

      Note: If you want to use LDAP authentication, set Auth Database to $external and set AuthScheme to PLAIN. This Auth Scheme value specifies the SASL PLAIN mechanism. This mechanism transmits credentials over plaintext, so it is not suitable for use without TLS/SSL on untrusted networks.

    • (Optional) Replica Set - Enter a comma-separated list of secondary servers in the replica set, specified by address and port.

      Example: ServerURL_1:27017,ServerURL_2:27017

    • (Optional) DNS Server - Enter the hostname of a domain name system (DNS) server that can resolve the necessary DNS entries.

    • Use SSL - Specify whether you want to use the Secure Sockets Layer (SSL) protocol. The default value is False.

  2. Define advanced connection settings on the Advanced tab. (In most cases, though, you should not need these settings.)

  3. Click Create & Test to create your connection.

More Information

For more information about interactions between CData Sync and MongoDB, see MongoDB Connector for CData Sync.