Using the MongoDB Source Component
The MongoDB Source Component is an SSIS data flow pipeline component that can be used to read/retrieve data from MongoDB.
The Main page of the MongoDB Source Component allows you to specify the general settings of the component.
- Connection Manager
The MongoDB Source Component requires a MongoDB connection in order to connect with MongoDB. The Connection Manager drop-down will show a list of all MongoDB connection managers that are available to your current SSIS package.
The Database dropdown shows a list of MongoDB Databases available to you. After selecting the Database you wish to read from, the Collection drop down will be populated with Collections in the selected Database.
The Collection specifies the MongoDB Collection you wish to read from.
- Output Column
This is the name of the output column that will contain the Documents returned from the MongoDB Collection selected.
- Convert ObjectId to String
This will extract the hexadecimal string from the ObjectId method in _id fields. Doing this makes the output data valid JSON.
Specify a MongoDB filter string to filter the Documents returned from the MongoDB Collection selected.
- Advanced Editor... Button
Launches the Advanced Editor that allows you to create MongoDB filter strings.
Specify a MongoDB projection string to limit the fields returned in each Document.
- Projection Tool... Button
Launches the Projection Tool that allows you to generate a MongoDB projection string from an existing JSON Document.
- Refresh Component Button
Clicking the Refresh Component button causes the component to retrieve an updated list of Databases and Collections.
The Advanced Editor allows you to construct MongoDB filter strings from a list of conditions and operators. It also supports injecting variables into the expression.
Drag and drop filter string items from the list of available conditional items in the top right tree view. Then modify the expression as needed. You can also drag and drop variables from the top left tree view. When done, click the OK button to return to the MongoDB Source Component Editor with the newly constructed Filter String.
The Projection Tool allows you to generate a MongoDB projection string from an existing JSON Document.
Click the Import JSON button on the bottom left then check/uncheck the fields in the hierarchical list you wish to return. When done, click the OK button to return to the MongoDB Source Component Editor with the autogenerated projection string.