August 15, 2023

Reading data from MongoDB – Docs for ESB 6.x

Reading data from MongoDB

  1. Double-click tMongoDBInput to open its
    Component view.

    use_case-mongodbinput_spark_batch6.png

  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.

    use_case-mongodbinput_spark_batch7.png

    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.

Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x