Configuring the components
Procedure
- Double-click tMongoDBConnection to open its Basic settings view.
- From the DB Version list, select the MongoDB version you are using.
-
In the Server and Port fields, enter the connection details.
In the Database field, enter the name of the MongoDB database.
-
Double-click tFixedFlowInput to open its
Basic settings view.
Select Use Inline Content (delimited file) in the Mode area.In the Content field, enter the data to write to the MongoDB database, for example:
Andy;Open Source Outlook;Open Source,Talend;Talend, the leader of the open source world... Andy;Data Integration Overview;Data Integration,Talend;Talend, the leading player in the DI field... Andy;ELT Overview;ELT,Talend;Talend, the big name in the ELT circle...
-
Double-click tMongoDBRow to open its
Basic settings view.
Select the Use existing connection check box.In the Function field, enter the MongoDB function to create the collection blog and insert data to it:
"function(author,title,keywords,contents){ return db.blog.save( {author:author,title:title,keywords:keywords,contents:contents} ); }"
-
Click the [...] button next to Edit schema to open the schema editor.
-
Click the [+] button to add four columns
in the right part, namely author,
title, keywords and contents,
with the type of String.
Click to copy all the columns to the input table.Click OK to close the editor.
- In the Parameters value table, click the [+] button to add four lines and enter the values in sequence: row1.author, row1.title, row1.keywords and row1.contents. By doing so, data of row1 will be transferred to the parameters defined in the function.
-
Double-click tMongoDBInput to open its
Basic settings view.
Select the Use existing connection check box.In the Collection field, enter the name of the collection, namely blog.
-
Click the [...] button next to Edit schema to open the schema editor.
-
Click the [+] button to add four columns,
namely author, title, keywords and
contents, with the type as String.
Click OK to close the editor.
-
Double-click tLogRow to open its
Basic settings view.
In the Mode area, select Table (print values in cells of a table for better display.
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!