Connect your BI tool, such as Tableau, Power BI, or DBeaver to your MongoDB Atlas or Enterprise Advanced (EA) database.
Note
MongoDB officially supports Tableau (Desktop or Server) and Power BI Desktop (Desktop and Service) with its JDBC and ODBC drivers. You can use the JDBC and ODBC drivers with other SQL-92 BI tools, but MongoDB cannot guarantee compatibility. Test your specific SQL Interface features to confirm support.
Connect Tableau
Connect either an Atlas federated database instance or an self-hosted Enterprise Advanced (EA) database to Tableau (Desktop or Server) using the Tableau Connector for MongoDB.
Prerequisites
A MongoDB database, configured for the SQL Interface.
The MongoDB JDBC driver. To install, see Install the JDBC Driver.
Tableau Desktop or Server. For Tableau Server, SCRAM authentication is the only authentication mechanism supported at this time.
Procedure
The following steps show you how to connect to MongoDB with Tableau:
Download the Tableau Connector for MongoDB.
Download the latest Tableau Connector
tacofile from the MongoDB download center.Move the
tacofile into the appropriate directory for your operating system:Windows:
C:\Users\<user>\Documents\My Tableau Repository\ConnectorsMacOS:
~/Documents/My Tableau Repository/ConnectorsLinux:
/opt/tableau/connectors
Important
If you download a new version of the Tableau Connector for MongoDB,
delete the previous taco file from your Connectors
directory to ensure that Tableau uses the latest version.
Get your MongoDB database connection information.
Select the tab for your deployment type for instructions on how to get your connection information:
Go to your Atlas federated database instance for your project.
Click the Connect button.
Select the Atlas SQL Interface option.
Select the Tableau Connector option under the Select your driver dropdown.
Select Tableau from the dropdown.
Select the database you want to connect to from the Database dropdown.
Copy your connection string and connection parameters.
Use this information to connect with Tableau in a later step.
Use your connection string for mongosh.
Select your authentication method.
Choose your Authentication Mechanism from the dropdown.
Username: Enter your MongoDB username.
Password: Enter your MongoDB password.
Configure your PEM certificate using one of the following methods:
Use a PEM File Path:
In your
mongodb_jdbc.propertiesfile, set thex509pempathproperty to your PEM file's path. For example,x509pempath=/certs/client-cert.pem.If your PEM file is unencrypted, do not select Provide PEM Contents. No further action is required.
If your PEM file is encrypted, select Provide PEM Contents and enter the file's passphrase in the Password field.
Provide PEM Contents:
Select the checkbox next to Provide PEM Contents and enter your certificate data into the Password field:
Unencrypted Content: Paste the full certificate content directly into the field.
Encrypted Content: Paste a JSON object containing the content and passphrase:
{ "pem": "<PEM-CONTENT>", "passphrase": "<PEM-PASSPHRASE>" }
Enter the Kerberos principal name in the Username field.
For example, user@EXAMPLE.COM.
No additional properties or fields are required in the connection dialog for OIDC.
Connect Power BI
Connect either an Atlas federated database instance or a self-hosted Enterprise Advanced (EA) database to Power BI using the Power BI Connector for MongoDB.
Prerequisites
A MongoDB database, configured for the SQL Interface.
The MongoDB ODBC driver. To install, see Install the ODBC Driver. To use About Direct Query, you must install version 1.2 or later.
Power BI Desktop 64 bit. Microsoft updates and releases Power BI monthly, and Atlas supports only the latest version of Power BI Desktop.
Windows operating system. To learn the Windows OS versions that Power BI Desktop supports, see the Microsoft documentation.
Procedure
The following steps show you how to connect to MongoDB with Power BI:
Download the Power BI Connector for MongoDB.
Download the latest Power BI Connector
pqxfile from the MongoDB download center.Note
The Power BI Connector for MongoDB ships with Power BI Desktop. If your version of Power BI Desktop already has the MongoDB Atlas SQL connector, skip this step. To use a different version than the one bundled with Power BI Desktop, complete this step.
Move the connector file to the following directory path:
C:\Users\<user>\Documents\Power BI Desktop\Custom Connectors.Create this folder if it doesn't already exist.
Connect from Power BI Desktop.
Open Power BI Desktop.
Select Get data from the Home menu.
Find and select the MongoDB Atlas SQL connector.
Type
mongoin the search bar to find the new connector.Select MongoDB Atlas SQL.
Click Connect.
Enter the URI and the database name and click OK.
The MongoDB URI is the URL is the from the previous step.
You can also enter a SQL query in the Native query field. Power BI uses the SQL query as the direct source for the data.
Enter your Atlas User name and Password and click Connect.
By default, a user can access all clusters and federated database instances in projects to which they have access. If you restricted access to specific clusters and federated database instances, you can grant access to the new federated database instance in the Edit User menu. To learn more, see Configure Database Users.
About Direct Query
Direct Query is a connection mode available with the Power BI Connector for MongoDB version 1.2 and later. To use Direct Query, you must install MongoDB ODBC Driver version 1.2 or later.
Direct Query is alternative to the standard Import Mode, and allows you to query your database directly. This guarantees up-to-date data but may take longer to return results.
Direct Query does not support some actions. If you try to perform an unsupported action, Power BI prompts you to switch to Import Mode.
Connect DBeaver
Connect your Atlas federated database instance to DBeaver using the MongoDB JDBC Driver.
Prerequisites
An Atlas federated database instance mapped to one or more data stores. To learn more, see Deploy a Federated Database Instance.
Note
If some or all of your data comes from an Atlas cluster, you must use MongoDB version 5.0 or greater for that cluster to take advantage of MongoSQL.
The MongoDB JDBC driver. To install, see Install the JDBC Driver.
Procedure
To connect to your federated database instance from DBeaver:
In Atlas, go to your federated database instance for your project.
If it's not already displayed, select the organization that contains your project from the Organizations menu in the navigation bar.
If it's not already displayed, select your project from the Projects menu in the navigation bar.
In the sidebar, click Data Federation under the Services heading.
The Data Federation page displays.
Open your DBeaver application.
Add a driver to DBeaver.
In DBeaver, click Database and select Driver Manager from the dropdown menu.
Click New to open the Create new driver modal.
In the Settings tab, specify the following information:
Driver Name
MongoSQLClass Name
com.mongodb.jdbc.MongoDriverIn the Libraries tab, click Add File and add your JDBC driver
all.jarfile.Click Find Class.
Click OK. The Create new driver modal closes.
Create a database connection.
In DBeaver, click Database and select New Database Connection from the dropdown menu to open the Connect to a database modal.
From the list of databases, select the
MongoDBdatabase driver that you created in the previous step.If you don't see
MongoDB, select the All category inside the modal.Click Next.
In the Main tab, enter the following information:
JDBC URL
Connection string obtained from a previous step.
Username
MongoDB user authorized for the connection.
Password
Password associated with the MongoDB user.
In the Driver properties tab, expand User Properties. Add the following key-value properties:
database
The name of your virtual database.
user
The MongoDB user to connect with. Not required if you entered a
Usernamein the previous step.
Next Steps
After you connect your BI tool with your MongoDB database, you can query your data. To learn more, see:
Note
To connect using a private endpoint, see Connect to MongoSQL with a Federated Database Instance Private Endpoint. To connect using the MongoDB Shell, see Connect from the MongoDB Shell.