Skip to main content

Reporting with MongoDB

Deprecation

From May 2022, the support for importing data from MongoDB has ended. Please check out the announcement and suggested solution here.

This document shows how you can set up reporting when you're using MongoDB as your primary data source.

High-level Approach

Our bias is that MongoDB are not well-designed for analytics purpose, we recommend you to set up a SQL data warehouse, and use an ELT tool to load data into the warehouse.

The general steps are as follows:

  1. Setting up a SQL database as data warehouse
  2. Load data from MongoDB into SQL data warehouse (EL)
  3. Transform data to unnest nested fields and nested arrays
  4. Perform reporting operations off the SQL database

Step-by-step Guide

1. Setting up SQL data warehouse

If you don't already have a SQL data warehouse, you will need to set up one. Refer to this page for guides on how to set up SQL databases as data warehouse.

After spinning up SQL data warehouse, please connect them to Holistics.

2. Load data from MongoDB into your SQL data warehouse

Holistics has a built-in EL(T) functionality to pull data from MongoDB to SQL database. After that, users can easily query and create dashboards/reports easily using SQL.

Use the Import Models functionality to load individual MongoDB collections into data warehouse tables. It will automatically create the tables in your SQL datawarehouse, and pull the MongoDB data into it.

3. Transform nested fields and nested arrays

MongoDB deal with a lot of nested fields/arrays. Please refer to the section below on how to work with nested fields/arrays in MongoDB.

Handling nested/JSON data in Holistics

4. Build reports and visualizations

Now that you have loaded MongoDB data into SQL database, you can use Holistics Reporting to aggregate and visualize the data.

And put them together into a dashboard.


Let us know what you think about this document :)