You can set up a connection between Klipfolio and MongoDB to display data from your database on a dashboard.
How do I connect to MongoDB data in Klipfolio?
Important: Before connecting Klipfolio with MongoDB, ensure the IP addresses listed here have been whitelisted.
To connect to MongoDB data in Klipfolio, you will need to provide your Host name, Database Name and a Collection Name. You can get this information from the administrator of your organization.
Before entering Query Parameters on the Configuring Data Source page, you will need to select a Collection Method. See below for more information on the Find and Aggregate options:
Query parameters for Find:
In the Query Parameters text box, enter the query and/or projection parameters in valid JSON/BSON format.
For example: [{id : {$eq : 1}}, {name : 1}]
If you enter {} in the Query Parameters text box, all documents in the collection will be returned.
Learn more about the Find collection.
Query parameters for Aggregate:
In the Query Parameters text box, enter the pipeline parameter in JSON/BSON format.
For example: [{$project : {id:1, fname:1}},{$group: {id: dept, total: {$sum: $amount}}}, {$sort: {id: -1}}]
Learn more about the Aggregate collection.
To connect to and query a MongoDB data source:
- Navigate to the Service Connectors page in Klipfolio and choose MongoDB from the list.
- On the Configure your data source page, enter the following:
- At Host, enter your Host name.
- At Port, use the default port number provided by Klipfolio.
- At Enable SSL, optionally select Enable SSL connection.
- At Authentication, optionally select Connect with username and password. Make sure you also enter the correct authentication database name where the role of your username and password exists.
- At Database Name, enter your provided Database Name.
- At Collection Name, enter your provided Collection Name.
- At Collection Method, select either Find or Aggregate. See more information above.
- At Query Parameters, enter your Query Parameters based on your chosen Collection Method.
- Click Get data.
- Ensure this is the data you’re looking for. If you’re using Klips, optionally select the checkbox to Model your data. If you’re using PowerMetrics, which requires modelled data sources, you’ll automatically enter the modeller after clicking Continue. Learn more about modelling data sources.
- Click Continue.
- Name, choose refresh settings, and, optionally, share your data source.
- Click Save.
How do I create a MongoDB custom Klip?
You create custom Klips from either your list of Klips or your Dashboard. You choose a data visualization format, for example, a pie chart, gauge, or table, and decide whether you want to use an existing data source or create a new one. In the Klip Editor, there are limitless opportunities to modify, relate, and display your data. See the following related articles for more information and get building!