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 tMongoDBInput to open its
Basic settings view.
- Select the Use existing connection option.
- 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 five columns, namely id, author, title, keywords and contents, with the type as Integer and String respectively.
- Click OK to close the editor.
- The columns now appear in the left part of the Mapping area.
- For columns author, title, keywords and contents, enter their parent node post so that the data can be retrieved from the correct positions.
-
In the Query box, enter the advanced
query statement to retrieve the posts whose author is Anderson:
"{post.author : 'Anderson'}"
This statement requires that the sub-node of post, the node author, should have the value "Anderson". -
Double-click tLogRow to open its
Basic settings view.
Select Table (print values in cells of a table) for a better display of the results.