MongoDB Destination Component is an SSIS Data Flow Component for creating, replacing, updating and deleting documents in a MongoDB database that supports multiple inputs via the composite records pattern.
- Supports 'Create', 'Replace', 'Update' and 'Delete' operations on MongoDB documents.
- Supports nested documents in array(s) by offering separate inputs for populating the array items.
- Supports batch creation of documents.
- Provides information about failures during processing, as well as the
ObjectIdidentifier for added, updated or deleted documents.
In this section we will show you how to set up a MongoDB Destination component.
- Double-click on the component on the canvas.
- You first need to generate the structure of MongoDB Destination by selecting a Connection Manager and a collection. You would need to have at least one document in the collection for the component to be able to automatically create the inputs and the corresponding external columns. So double click on the MongoDB Destination component and select "Yes" in the following dialog.
- Connect the blue arrow from the source component or the data flow transformation that you want to immediately precede the MongoDB Destination component. As in MongoDB you can have complex object with nested arrays, MongoDB Destination can have multiple inputs, so you need to select to which input you want to provide data.
To learn more about multiple inputs, please check this article. To load hierarchical data in such inputs, they need to be connected to upstream source or transformation components in a special way (e.g. a Query Transformation can be used to retrieve the necessary data from SQL Server database).
Congratulations! You have successfully configured the MongoDB Destination component.
Use the parameters below to configure the component.
Select an existing MongoDB connection manager.
Select destination object action. This property has the options listed in the following table.
Action Description Create Create new documents in the destination MongoDB collection. Replace Replace the entire contents of existing documents (identified by '_id') in the destination MongoDB collection. Update Updates/sets specified field values in existing documents (identified by '_id') in the destination MongoDB collection. NOTE: Updating fields of array items is not supported. Delete Deletes existing documents (identified by '_id') from the destination MongoDB collection.After changing an action, please use Refresh command in the 'Mapping' tab to reload destination page metadata.
The MongoDB collection where documents would be created/updated/deleted
The number of documents to analyze when deducing the schema of the MongoDB collection (i.e. outputs, columns names and column types).
The time zone for dates processing. Allows converting dates to UTC or local time.
Since version 2.2, the component is providing result information in the Result Output. All successfully processed rows are copied to the Result Output. Additionally, the row id and optional status text are returned. Since version 2.2, the Id column is removed from the Error Output, now only error rows are output in the Error Output.
- Where can I find the documentation for the MongoDB Destination?
- How to work with composite records handling in a MongoDB destination component.
- How to find which documents failed/succeeded in the MongoDB destination component.
- Fixed: Failed to process input columns of type
- Fixed: Modified to preserve the order of the columns from the input.
- Fixed: Failed with error "Command 'listCollections' failed: command not found..." when using MongoDB Atlas (Thank you, Raphael).
- New: Introduced component.