MongoDB Source Connector
The MongoDB source connector lets DataSync retrieve data from a MongoDB instance and load it into your data warehouse. DataSync supports two authentication modes: Basic and NoAuth.
MongoDB stores data as nested documents. The connector can automatically flatten nested objects into separate columns, making them easier to work with in your data warehouse.
Once your source connection is ready, configure your destination connection to finish the setup.
The consolidation extraction is not available for MongoDB source connections.
Create the source connection in DataSync
- Log in to DataSync.
- From the welcome screen, select Connections.
- Next to Source Connections, click New.
- Select MongoDB.
- Enter all required connection properties.
- (Optional) In the Additional Connection Properties panel, click Add property and enter any extra parameters you need.
- Configure the advanced settings to match your environment, including Tracking Type.
- Click Save.
MongoDB can store columns that contain arrays of values. When this happens, DataSync may not correctly estimate the column size, which can cause data to be cut off during extraction. To prevent this, set the precision to MAX for those columns in your destination table.
Connection properties
| Property | What to enter |
|---|---|
| Description | Unique name for the connection. Example: MongoDB. |
| Server | Server name or IP address of the MongoDB server. Example: mongodb.example.com |
| Port | Port number for the MongoDB connection. Default: 27017. |
| Database | Name of the MongoDB database to connect to. Example: SalesData. |
| Authentication Mode | Basic for username and password authentication stored in the MongoDB database, or NoAuth for connections that require no authentication. |
| Username | Basic only Login account stored in the MongoDB database. Example: mongoUser. |
| Password | Basic only Password for this account. |
| Authentication Database | Basic only Name of the database used for authentication, if different from the database in the Database field. Example: admin |
| Flatten Objects | Converts nested object properties into separate columns. When disabled, nested objects are returned as JSON strings. |
| Use SSL/TLS | Secures the connection using SSL/TLS encryption. Requires a valid SSL certificate. |
| Allows Invalid Server Certificates | Accepts all certificates from the server when SSL/TLS is enabled. Not recommended as it exposes the connection to security risks. |
| Row Scan Depth | Number of rows scanned to infer the collection schema. A higher value produces a more accurate schema but may slow down the initial connection. Default: 1000. |
| Verbosity | Controls how much detail the connector writes to the log. Each level includes everything from the level below it, plus additional detail.
|
| Enable Pooling | Enables connection pooling, which keeps a set of database connections open and reuses them across extractions instead of opening a new connection each time. This reduces overhead and improves performance when multiple extractions run at the same time. |
| Pool idle timeout | Time in seconds a connection can stay idle before returning to the pool. |
| Max Pool Size | Maximum number of connections allowed in the pool at the same time. |
| Pool wait time | Time in seconds DataSync waits for an available connection before throwing an error. |
Flatten Objects example
MongoDB stores data as nested documents, meaning a single record can contain objects within objects. When Flatten Objects is enabled, DataSync breaks those nested properties into individual columns, making the data easier to query and analyze in your data warehouse.
Take this sales document as an example. The customer and shipping fields each contain nested properties:
{
"orderId": 10592,
"customer": { "id": 456, "name": "Acme Corp" },
"shipping": { "city": "New York", "state": "NY" }
}
- When enabled
- When disabled
When enabled
With Flatten Objects enabled, each nested property becomes its own column:
orderId 10592
customer.id 456
customer.name Acme Corp
shipping.city New York
shipping.state NY
When disabled
With Flatten Objects disabled, nested properties stay inside a JSON string:
orderId 10592
customer {"id": 456, "name": "Acme Corp"}
shipping {"city": "New York", "state": "NY"}
Additional connection properties
Use this panel to enter connection string properties not available in the Connection Properties panel. For sensitive values such as passwords, set the type to Encrypted. The value is hidden in the interface and stored encrypted in the back end.
| Property | What to enter |
|---|---|
| Property | Connection string property that defines the action or behavior. Example: ReadOnly |
| Value | Value for the property. Example: True |
| Type | Visibility settings: Visible or Encrypted. |
Advanced settings
These settings control how the connector tracks data changes, handles time and regional configuration, and processes records during extraction. Configure them to match your MongoDB environment so that results stay accurate and consistent.
| Setting | What to select |
|---|---|
| Tracking Type | Method for tracking data changes: None or Date. |
| Region | Region setting for the connector, if required by your setup. |
| Time Zone | Time zone matching your MongoDB environment. |
| Time Offset | Refresh offset in seconds to compensate for timing issues in record selection. Minimum 0, maximum 3600. |
| Batch Size | Number of records processed per batch during extraction. Larger batches can improve performance but use more memory. Default is 2000, maximum is 10000. Adjust based on your network speed and disk performance. The default works well in most cases. |
Example setup
