You can use the MongoDB connector in both source and target endpoints.
In source endpoints, the connector retrieves data from MongoDB databases.
In target endpoints, it inserts data to MongoDB databases.
Source endpoint
Configuration
Source endpoint API model
Source data type mapping
To configure a MongoDB source endpoint, take the following steps:
In Connection type,
select whether you want to connect to MongoDB with the standard connection (Custom installation)
or with SRV.
Custom installation uses the standard connection method,
and you need to specify all hosts and ports.
SRV provides a simplified way to connect to MongoDB clusters,
in particular those on MongoDB Atlas.
Configure the connection:
Custom installation
Under Host,
click + Host and enter the domain name (FQDN) or IP address of the host.
In Replica set, enter the replica set ID.
In Port, enter the port to connect with.
To encrypt data transmission,
upload a .pem file with the certificate (public key) under CA Certificate.
In Authentication source, enter the name of the database associated with the user and password.
In User and Password, enter the user credentials to connect to the database.
Standard MongoDB connection string reference
Typically, a MongoDB connection string looks as follows:
<hostname>: IP-address or the domain name (FQDN) of the MongoDB server.
<database>: Name of the database to connect to.
In Authentication source, enter the name of the database associated with the user and password.
In User and Password, enter the user credentials to connect to the database.
In Database name, enter the name of the database where 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 in the source.
Select a Cleanup policy to specify
how data in the target database is cleaned up when a transfer is activated, reactivated, or reloaded.
Cleanup policy reference
Disabled:
Don’t clean. Select this option if you only perform replication without copying data.
Drop (default):
Fully delete the tables included in the transfer.
Use this option
to always transfer the latest version of the table schema to the target database from the source.
Truncate:
Execute the
remove()
command for the target table each time you run a transfer.