To read data from MongoDB, configure a MongoDB V2 object as the Source transformation in a mapping in advanced mode.
Specify the name and description of the MongoDB V2 source. When you configure a Source transformation, you can add or remove source fields of primitive data types.
The following table describes the source properties that you can configure for a MongoDB V2 source:
Property
Description
Connection
Name of the MongoDB V2 source connection.
You can select an existing connection or create a new connection. You can also click New Parameter to define a parameter for the source connection.
Source Type
Type of the source object.
Select Single Object, Multiple Objects, or Parameter.
Related objects appear based on simple primary key-foreign key relationship. You can use the Advanced Relationship option to define the relationship for objects that you want to join.
Object
Name of the MongoDB V2 source object based on the source type selected.
Select the source object for a single source. When you select the multiple source option, you can add source objects and configure a relationship between them.
Joining multiple objects
When you create a Source transformation, you can select multiple MongoDB V2 objects as the source type and then configure an advanced relationship to combine the tables.
Perform the following steps to join multiple objects in a Source transformation:
1In the Source transformation properties, select the Source Type as Multiple Objects.
2From the Actions menu, select Add Source Object, and then select the source object that you want to add from the displayed list.
3From the Related Objects Actions menu, select the Advanced Relationship option to define the relationship between the tables.
The following image shows an advanced relationship condition defined between MongoDB tables:
Note: You can join only two source tables. You must define only the join condition, not the complete join query.
Adding and removing source fields
You can configure the source fields that you want to use in the data flow.
You can add fields to a mapping source and retrieve a field from the source object that is not displayed in the list. To add a field, click , and then enter the field name, type, precision, and scale. You can also remove fields that you do not want to use in the mapping. To remove a field, select the field and then click .