Prerequisites
Before you begin, make sure you have:- A MongoDB collection within Typper BI’s data sources.
Running a MongoDB Query
To execute a MongoDB query, follow these steps:- Navigate to the SQL query section in Typper BI.
- Instead of SQL, you’ll provide a JSON object to specify the MongoDB query. The JSON object should be structured as follows:
copy
aggregateParams
, provide the aggregation pipeline as a JSON object that defines the stages of your MongoDB query.
Example
Here’s an example of a simple aggregation that counts the number of documents grouped by a category field:copy
Executing the Query
After defining your query:- Paste the JSON query into the Typper BI interface where SQL queries are typically entered.
- Click the Run button to execute the query.
Limitations and Notes
- Ensure that your JSON is properly formatted; otherwise, the query will not execute.
- The aggregateParams field must contain a valid MongoDB aggregation pipeline array. Each element in the array represents a stage in the pipeline.