Reading data from MongoDB - 7.1

MongoDB

author
Talend Documentation Team
EnrichVersion
Cloud
7.1
EnrichProdName
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Open Studio for Big Data
Talend Real-Time Big Data Platform
task
Data Governance > Third-party systems > Database components > MongoDB components
Data Quality and Preparation > Third-party systems > Database components > MongoDB components
Design and Development > Third-party systems > Database components > MongoDB components
EnrichPlatform
Talend Studio

Procedure

  1. Double-click tMongoDBInput to open its Component view.
  2. Click the [...] button next to Edit schema to open the schema editor.
  3. Click the [+] button to add the schema columns for output as shown in this image.
    If you want to extract the technical ID of each document, add a column called _id to the schema. In this example, this column is added. These technical IDs were generated at random by MongoDB when the sample data was written to the database.
  4. In the Collection field, enter the name of the collection from which you need to read data. In this example, it is the director one used previously in tMongoDBOutput.
  5. In the Mapping table, the three output columns have been automatically added. You need to add the parent nodes they belong to in the MongoDB documents. In this example, enter, within double quotation marks, person in the Parent node path column for the id and the name columns and leave the _id column as is, meaning that the _id field is at the root of each document.
    The tMongDBInput component parses the extracted documents according to this mapping and writes the data in the corresponding columns.