How Connect to MongoDB using MongoDB BI Connector and MySQL
This article will guide you on how to connect to a MongoDB server using the MongoDB BI Connector and MySQL in Bold BI.
Prerequisites
- MongoDB BI Connector installed on your system. Download here
Steps to Connect MongoDB using BI Connector
Step 1: Configure the MongoDB BI Connector
- Open the command prompt and navigate to the MongoDB BI Connector installation path:
CD C:\Program Files\MongoDB\Connector for BI\2.14\bin
- Use the following command to connect the database and collection in MongoDB:
- To sample data from one collection in a database named
sampled
:
mongosqld --sampleNamespaces sampled
- To sample data from all collections in a database named
orders
, as well as theFY2015
andFY2016
collections from theexpenses
database:
mongosqld --sampleNamespaces 'orders.*' \
--sampleNamespaces expenses.FY2015 \
--sampleNamespaces expenses.FY2016 \
After connecting your BI connector with the MongoDB server successfully, you will get the list of available schemas in your server.
You will also get the Server name and Port No from the response: waiting for connections at 127.0.0.1:3307
Step 2: Connect to MySQL Data Source
-
Select the MySQL data source in the connection panel.
-
Provide the MongoDB BI Connector details in the MySQL data source. Choose the configured database and collection from the list and enter the credentials. Click Connect.
Your database and collections from MongoDB will now be available in Bold BI. This is a direct connection from MongoDB.
Step 3: Drag and Drop Collection and Save the Data Source
Drag and drop the collection and save the data source.
NOTE: Ensure that the MongoDB BI connector is reachable from outside networks and there are no firewall rules that block the connection.