MongoDB Reports
Create Analyzer & Interactive Reports from MongoDB ..
x
x
Linux
Ensure the Pentaho Server is up and running.
cd
cd /opt/pentaho/server/pentaho-server/
sudo ./start-pentaho.shEnsure Pentaho Data Integration is up and running.
cd
cd ~/Pentaho/design-tools/data-integration
./spoon.shCreate a New Transformation

Select the Design tab in the left-hand-side view.
x
x
x
x
Linux
Ensure the Pentaho Server is up and running. The Hypersonic Database Server - SteelWheels - is an embedded service.
Ensure Pentaho Data Integration is up and running.
Create a New Transformation

Select the Design tab in the left-hand-side view.
From the Input category folder, find the Table Input step and drag and drop it into the working area in the right-hand-side view.
Double-click on the Table Input step to open the configuration dialog.
Set the Step Name property to Select Customers.
Click on the New button next to the Database Connection pulldown. This will open the Database Connection dialog.
Enter the following details:
You can test the connection by clicking on the Test button at the bottom of the dialog. You should get a message similar to Connection Successful. If not, then you must double-check your connection details.
Click on OK to return to the Table Input step.
Now that we have a valid connection set, we are able to get a list of customers from the SteelWheels database. Copy and paste the following SQL into the query text area:
Click on the Preview button and you will see a table of customer details.
x
Under the Design tab, from the Big Data category folder, find the MongoDB Output step and drag and drop it into the working area in the right-hand-side view.
Create a Hop from the Table Input step to the MongoDB Output step.
Double-click on the MongoDB Output step.
Enter the following details:
Now, let's define the MongoDB documents structure. Select the Mongo document fields tab.
Click on the Get fields button, and the fields list will be populated with the SteelWheels database fields in the ETL stream.
By default, the column names in the SteelWheels database are in uppercase. In MongoDB, these field names should be in camel case. You can manually edit the names of the MongoDB document paths in this section also. Make sure that the Use Field Name option is set to No for each field, like this:
x
By clicking on Preview document structure, you will see an example of what the document will look like when it is inserted into the MongoDB Customers collection.
Click on the OK button to finish the MongoDB Output configuration.
RUN
x
x
Linux
Ensure the Pentaho Server is up and running. The Hypersonic Database Server - SteelWheels - is an embedded service.
Ensure Pentaho Data Integration is up and running.
Create a New Transformation
Select the Design tab in the left-hand-side view.
From the Big Data category folder, find the MongoDB Input step and drag and drop it into the working area in the right-hand-side view.
Double-click on the step to open the MongoDB Input dialog.
Set the step name to Select 'Baane Mini Imports' Orders.
Select the Input options tab. Click on the Get DBs button and select the SteelWheels option for the Database field. Next, click on Get collections and select the Orders option for the Collection field.
Select the Query tab and then check the Query is aggregation pipeline option. In the text area, write the following aggregation query:
Uncheck the Output single JSON field option.
Select the Fields tab.
Click on the Get Fields button and you will get a list of fields returned by the query.
You can preview your data by clicking on the Preview button.
Click on the OK button to finish the configuration of this step.
x
We want to add a Dummy step to the stream. This step does nothing, but it will allow us to select a step to preview our data. Add the Dummy step from the Flow category to the workspace and name it OUTPUT. 4. Create a hop between the Select 'Baane Mini Imports' Orders step and the OUTPUT step. 5. Select the OUTPUT dummy step and preview the data. 19
x
x
x
x
x
Linux
Open the Schema Workbench application. With the Schema Workbench opened, let's configure the MongoDB database connection.
In the main menu, select Options -> Connection, and enter the following details:
Click on the Test button and you should get a success message box. Then click on the OK button.
Date Dimension
In the main menu, go to File -> New -> Schema.
x
Select the Schema object and set Orders as the field name.
Right-click on the Schema object and select Add Dimension.
Add a table to the hierarchy by right-clicking and selecting Add Table.
After selecting the table object added, select the -> date option for the name field.
In the default hierarchy (New Hierarchy 0), right-click and select the Add Level.
Let's define the year for this new level, enter the following details:
Add a new level and define the month; enter the following details:
Next, add a new level and define the day:
Select the hierarchy object, remove the default name (New Hierarchy 0), and select date for the primaryKey field.
Next, select the dimension object, and for the name field, set: date.
In the type field, select TimeDimension.
Finally, in the caption field, set Date.
x
x
x
x
x
x
x
x
Was this helpful?
