You can configure certain additional options in the Additional Properties field in a MongoDB V2 connection that apply for a mapping or a mapping in advanced mode.
Sampling properties
You can configure the following sampling properties in a mapping or a mapping in advanced mode:
samplesize
The number of documents to scan to infer the schema from the MongoDB source.
For example, samplesize=100.
Default is 100.
samplemethod
The method to sample documents to infer the schema from the MongoDB source.
You can specify one of the following methods:
- firstpage. Scans first n documents from MongoDB where n indicates the sample size. MongoDB determines the ordering of rows for scanning.
- random. Scans n number of random documents from MongoDB.
- all. Scans the entire collection to infer the schema.
- none. Scans the entire collection to write multi-level hierarchical data without flattening from a MongoDB source to a MongoDB target in a mapping. This feature does not apply to mappings in advanced mode.
You can write to an empty MongoDB collection only when you specify none as the samplemethod.
Non-SSL MongoDB deployments
You can configure the following additional properties to connect to non-SSL MongoDB deployments in a mapping or a mapping in advanced mode:
ssl
Determines if the connection uses SSL or non-SSL.
Set this parameter to false in the connection properties to connect to MongoDB deployments that do not use SSL.
Default is true.
authsource
Allows you to provide the database name against which you can authenticate user credentials.
For example, authsource=testadmin.
Default is admin.
Amazon DocumentDB
You can configure the following additional properties to connect to Amazon DocumentDB in a mapping in advanced mode:
ssltruststorefilepath
The absolute path of the truststore file in the Secure Agent machine that contains the keys and certificates required to establish a secure communication.
For example, ssltruststorefilepath= <path_of_truststore_file>
For the serverless runtime environment, specify the following certificate path to the serverless agent directory:
You can configure the following additional properties to write to Azure CosmosDB enabled with the MongoDB API in a mapping:
retryWrites
Determines if a mapping can automatically retry attempts to write to Azure CosmosDB.
For example, to write to Azure CosmosDB, enter retryWrites=false.
If you set this parameter, the target connection disables the automatic retry mechanism when you write to Azure CosmosDB and you can't configure validation rules for an Azure CosmosDB collection.
If you don't set this parameter, the target connection enables the automatic retry mechanism by default.
Default is true.
You don't need to set this property to false when you read from Azure CosmosDB.
For more information, see Retryable Writes in the MongoDB documentation.
Handle columns with null values
You can configure the following additional properties to handle columns with null values when writing data to a MongoDB V2 target in a mapping or in advanced mode:
OmitNullColumns
Determines whether a mapping omits columns with null values when writing to a MongoDB V2 target.
For example, to omit columns with null values, enter OmitNullColumns=true.
If you set this parameter, you can't configure the samplemethod additional property value to none.
If you don't set this parameter, the mapping writes columns with null values to the target.
Default is false.
SkipRowsWithNullUpdateColumns
Determines whether a mapping omits update columns with null values when performing an update, upsert, or data-driven operation on the target.
For example, to omit update columns with null values, enter SkipRowsWithNullUpdateColumns=true.
If you set this parameter, you can't configure the samplemethod additional property value to none.
If you don't set this parameter, the mapping writes update columns with null values to the target.