To create a custom MongoDB resource defined via an aggregation pipeline, first navigate to Company Settings (left navigation) → Data Sources (tab). Click on the desired MongoDB data source.
In the “Resources” section, click on “Add New”:
Enter in a name for your custom resource at the top - this is the name that will be used within Internal.
Then, enter in the name of the MongoDB collection with your data. This must match an existing collection within your MongoDB data source.
Within the input field, you can enter in your aggregation pipeline to define the data that you want in your resource. See the screenshot above for an example. For more information on aggregation, you can refer to the MongoDB documentation for quick reference and SQL-to-aggregation mapping chart.
Hit “Apply” to create your custom resource.
Things to know about custom resources: