The MongoDB connector

You can use this connector both for source and target endpoints.

Source endpoint

  1. Select Connection settingsConnection type:

    1. Under Hosts, click + Host and specify IP-address or the domain name (FQDN) the of a host to connect to.

    2. Specify the Replica set for the connection.

    3. Provide the Port to use for connections. You can change the default port number if necessary.

    4. Under CA Certificate, click Upload a file to provide a certificate file (public key) in PEM format.

  2. Specify the database attributes:

    • Authentication source – a database name associated with user and password below.

    • Username – a user of the database for connection to Transfer service.

    • Password – a password of the database user.

  3. Under Collection filter:

    • Included collections. The Transfer service will transfer only the data from these collections.

    • Excluded collections. The data from the collections on this list won't be transferred.

To create a MongoDB source endpoint with API, use the endpoint.MongoSource model.

MongoDB type Transfer type
[int64](*int64)
[int32](*int32)
[int16](*int16)
[int8](*int8)
[uint64](*uint64)
[uint32](*uint32)
[uint16](*uint16)
[uint8](*uint8)
[float](*float)
[double](*double)
[string](*string)
bson [utf8](*utf8)
[boolean](*bool)
[date](*date)
[datetime](*datetime)
[timestamp](*timestamp)
bson any

Target endpoint

  1. Under Connection settingsConnection type:

    1. Click + Host name. In the input field, provide the FQDN of the host containing your MongoDB database.

    2. In the Replica set field, specify the mongod server group which provides data replication (if your cluster uses it).

    3. Specify the Port number (by default, 27018 for non-sharded clusters and 27017 for sharded ones).

    4. Click Choose a file to provide a CA certificate. In the File upload dialog, select a Method:

      Upload
      1. Click Choose a file.

      2. Find your .pem certificate and click Open.

      Text
      1. Open your .pem certificate in a text editor.

      2. Copy all the text from the opened file and paste it into the Content field.

    5. Click Submit. You'll see the Data loaded status message:

      mongodb-data-loaded

  2. Specify the database attributes:

    • Authentication source is the MongoDB database name associated with the username and password below.

    • Username for connection to the MongoDB database.

    • Password for the database user.

    • Database name is the name of the database to which you want to transfer your data.

      Warning

      If you don't specify a database name, the collections will be created in databases with the same names as on the source.

      If the field isn't empty, all data will be placed in the specified database.

    • Cleanup policy. This policy allows you to select a way to clean up data in the target database when you activate, reactivate or reload the transfer:

      • Disabled: Do not clean. Select this option if you only perform replication without copying data.

      • Drop: Fully delete the collections included in the transfer (default). Use this option to always transfer the latest version of the schema to the target database from the source.

      • Truncate: Execute the remove() command for a target collection each time you run a transfer.

The completed from should look as follows:

mongodb-form-ready

To create a MongoDB target endpoint with API, use the endpoint.MongoTarget model.

Transfer type MongoDB type
int64 bson
int32 bson
int16 bson
int8 bson
uint64 bson
uint32 bson
uint16 bson
uint8bson
float bson
double bson
string bson
utf8 bson
boolean bson
date bson
datetime bson
timestamp bson
any bson

See also

Previous