MongoDB Source Connector
The MongoDB source connector in DataSync lets you retrieve data from MongoDB instances for loading or synchronizing in your data warehouse. After creating all required source connections, configure your destination source to complete the connection setup.
The Consolidation extraction is currently not available for MongoDB source connections.
Create a source connection in DataSync
- Log in to DataSync.
- From the welcome screen, select Connections.
- Next to Source Connections, click New.
- Select MongoDB.
- In the Connection Properties panel, enter the connection properties.
- (Optional) In the Additional Connection Properties panel, select Add property and enter the parameters for each property.
- In the Advanced Settings panel, configure the settings, including the Tracking Type and other values according to your requirements.
- Click Save.
For properties that contain arrays, the inferred precision may be underestimated. This can cause truncation errors at extraction. Recommendation: Set the precision to MAX for these columns in your destination table to avoid failures.
Parameters
Connection properties
| Parameter | Description |
|---|---|
| Description | Unique name for the connection. Example: MongoDB. |
| Server | Hostname or IP address of the MongoDB server. Example: mongodb.example.com |
| Port | Port number of the server. Default: 27017. |
| Database | Name of the MongoDB database to connect to. Example: SalesData. |
| Authentication Mode | Authentication method for the database:
|
| Username | Account username stored in the MongoDB database Example: mongoUser. |
| Password | Password associated with the username. |
| Authentication Database | Name of the database used for authentication if different from the database specified in Database. Example: admin |
| Flatten Objects | Option to convert nested object properties into separate columns. If disabled, objects are returned as JSON strings. |
| Use SSL/TLS | Encryption setting for securing the connection with SSL/TLS. Requires an SSL certificate. |
| Allows Invalid Server Certificates | Option to accept all certificates from the server when using SSL/TLS. Not recommended due to security risks. |
| Row Scan Depth | Number of rows scanned in the collection to infer schema. A higher value produces a more accurate schema but may reduce performance. Default: 1000. |
| Verbosity |
|
| Enable Pooling | Connection pooling option for performance. |
| Pool idle timeout | Maximum idle time for connections before returning them to the pool, in seconds. |
| Max Pool Size | Maximum number of connections allowed in the pool. |
| Pool wait time | Maximum wait time for connection allocation before error is thrown, in seconds. |
Flatten Objects example
Consider the following sales document:
{
"orderId": 10592,
"customer": { "id": 456, "name": "Acme Corp" },
"shipping": { "city": "New York", "state": "NY" }
}
-
If
Flatten Objectsis enabled, the document appears as:Column Name Data Type Example Value orderId Integer 10592 customer.id Integer 456 customer.name String Acme Corp shipping.city String New York shipping.state String NY -
If
Flatten Objectsis disabled, nested properties remain inside JSON:{"city": "New York", "state": "NY"}
Additional connection properties
Additional connection string properties not specified in the Connection Properties panel. For each property added, you can choose Visible or Encrypted. Selecting Encrypted hides the value from the interface and stores it encrypted in the back end, such as when defining passwords.
| Parameter | Description |
|---|---|
| Property | Connection string property that defines the action or behavior. Example: ReadOnly |
| Value | Value for the property. Example: True |
| Type | Visibility of the property: Visible or Encrypted. |
Advanced settings
Advanced settings control how the MongoDB connector tracks changes, handles regional and time configuration, and processes data batches during extraction. These options allow fine‑tuning for performance and accuracy, and should be configured according to your system environment and operational requirements.
| Setting | Description |
|---|---|
| Tracking Type | Method for tracking changes: None or Date. |
| Region | Region setting for the connector, if required by your setup. |
| Time Zone | Time zone matching the MongoDB application server. |
| Time Offset | Refresh offset in seconds to compensate for timing issues in record selection. Minimum value is 0; maximum is 3600 seconds. |
| Batch Size | Quantity of records processed in each batch during extraction. Larger batch sizes increase memory usage but can improve performance up to a point. The default value is 2000 and the maximum should not exceed 10000 records. Adjust according to your network speed and disk performance; in most cases the default (2000) works best. |