Learn the "why" behind slow queries and how to fix them in our 2-Part Webinar.
Register now >
Docs Menu
Docs Home
/ /

Connect Your BI Tool

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 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.

  • 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.

The following steps show you how to connect to MongoDB with Tableau:

1
  1. Download the latest Tableau Connector taco file from the MongoDB download center.

  2. Move the taco file into the appropriate directory for your operating system:

    • Windows: C:\Users\<user>\Documents\My Tableau Repository\Connectors

    • MacOS: ~/Documents/My Tableau Repository/Connectors

    • Linux: /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.

2

Select the tab for your deployment type for instructions on how to get your connection information:

  1. Go to your Atlas federated database instance for your project.

  2. Click the Connect button.

  3. Select the Atlas SQL Interface option.

  4. Select the Tableau Connector option under the Select your driver dropdown.

  5. Select Tableau from the dropdown.

  6. Select the database you want to connect to from the Database dropdown.

  7. Copy your connection string and connection parameters.

    Use this information to connect with Tableau in a later step.

Use your connection string for mongosh.

3
4
5

A connection modal displays.

6

Enter your SQL Interface connection string you saved in a previous step.

7

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.properties file, set the x509pempath property 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.

8

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.

The following steps show you how to connect to MongoDB with Power BI:

1
  1. Download the latest Power BI Connector pqx file 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.

  2. 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.

2
  1. Open Power BI Desktop.

  2. Select Get data from the Home menu.

  3. Find and select the MongoDB Atlas SQL connector.

    1. Type mongo in the search bar to find the new connector.

    2. Select MongoDB Atlas SQL.

    3. Click Connect.

  4. 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.

  5. 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.

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 your Atlas federated database instance to DBeaver using the MongoDB JDBC Driver.

To connect to your federated database instance from DBeaver:

1
  1. If it's not already displayed, select the organization that contains your project from the Organizations menu in the navigation bar.

  2. If it's not already displayed, select your project from the Projects menu in the navigation bar.

  3. In the sidebar, click Data Federation under the Services heading.

The Data Federation page displays.

2
3
4
5

Atlas Data Federation provides a connection string to connect to your federated database instance. You'll need this in a later step.

6
7
  1. In DBeaver, click Database and select Driver Manager from the dropdown menu.

  2. Click New to open the Create new driver modal.

  3. In the Settings tab, specify the following information:

    Driver Name

    MongoSQL

    Class Name

    com.mongodb.jdbc.MongoDriver

  4. In the Libraries tab, click Add File and add your JDBC driver all.jar file.

    Click Find Class.

  5. Click OK. The Create new driver modal closes.

8
  1. In DBeaver, click Database and select New Database Connection from the dropdown menu to open the Connect to a database modal.

  2. From the list of databases, select the MongoDB database driver that you created in the previous step.

    If you don't see MongoDB, select the All category inside the modal.

    Click Next.

  3. 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.

  4. 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 Username in the previous step.

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.

Back

Driver Setup

On this page