Skip to main content Skip to complementary content

Writing data to MongoDB

Procedure

  1. Double-click tMongoDBOutput to open its Component view.
  2. If this component does not have the same schema of the preceding component, a warning icon appears. In this situation, click the Sync columns button to retrieve the schema from the preceding one and once done, the warning icon disappears.
  3. In the Collection field, enter the name of the collection to which you need to write data. If this collection does not exist, it will be automatically created at runtime.
  4. From the Action on data list, select the operation to be performed on the data. In this example, select Insert, which creates documents in MongoDB whether these documents already exist or not and in either case, generates a new technical ID for each of the new documents.
  5. In the Mapping table, the id and the name columns have been automatically added. You need to define how the data from these two columns should be transformed into a hierarchical construct in MongoDB.
    In this example, enter, within double quotation marks, person in the Parent node path column for each row. This way, each director record is added to a node called person. If you leave this Parent node path column empty, these records are added to the root of each document.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!