You can import a MongoDB collection as an ODBC data object and create mappings to write data to MongoDB in the Developer tool.
You must configure the ODBC driver and define the MongoDB schema before you import MongoDB collections.
When you run a MongoDB mapping, the Data Integration Service uses the Informatica MongoDB ODBC data source to load data to the MongoDB database.
When you run MongoDB mappings, ensure that the optimization level is set to none. If you do not set the optimization level as none, the mappings may fail.
You can configure the optimization levels at the following locations:
Mapping runtime configuration in the Developer tool
Data viewer runtime configuration in the Developer tool
Mapping deployment in application settings in the Developer tool
Mapping configuration of an application in the Data Integration Service through the Administrator tool
You can configure advanced write options for the Informatica MongoDB ODBC Driver in the ODBC driver properties.
You can configure the following write options in the ODBC driver properties:
Omit default null columns on insert
Drops columns with null values. Default is enabled.
Truncate documents larger than 16 MB
Truncates a document if the size is more than 16 MB in a writer mapping. MongoDB documents have a size restriction of 16 MB. If enabled, the Data Integration Service truncates the document that exceeds 16 MB when writing to MongoDB. If you disable the option when you run a write session, the Data Integration Service rejects the document that exceeds 16 MB. Default is disabled.
Enable Reading/Writing as JSON
Writes the JSON format of the data to the MongoDB document. If you select the option, a column with the field documentAsJSON appears in the collection when you write data to MongoDB. You cannot write into individual columns if you select this option. Default is disabled.
Enable updating multiple rows
Updates multiple rows in the MongoDB collection for every write operation. If there are multiple documents to update, the Data Integration Service updates multiple documents in the MongoDB collection for every write operation. If you clear this option and multiple documents require update, the Data Integration Service initiates write operation for each document update. Default is disabled.
Check GetLastError on writes
Calls the MongoDB CheckGetLastError() function to check for failures after each insert or update operation. Select this option to include fault tolerance in write operations. Clear this option to speed up the write operation. Default is enabled.
If the source and target data objects in the mapping contains container columns, connect either the container columns or the individual columns. If both the container columns and the corresponding individual columns are connected to the target data object, the Data Integration Service inserts duplicate columns in the MongoDB database.