DEV Community

Gustavo Gordillo
Gustavo Gordillo

Posted on

Connecting MongoDB with Tableau: A Step-by-Step Guide (Macbook client)

mongo+tableau

Introduction

In today's data-driven world, visualizing data is crucial for understanding trends and making informed decisions. MongoDB, a powerful NoSQL database, offers flexibility and scalability, while Tableau is one of the top tools for data visualization. By combining these two, you can effectively represent unstructured or semi-structured data stored in MongoDB. In this tutorial, we’ll guide you through the process of connecting MongoDB with Tableau using the MongoDB BI Connector, helping you to visualize your data effortlessly.


Table of Contents

  1. Prerequisites
  2. Downloading Drivers
  3. Connecting MongoDB to Tableau Using the BI Connector

Step 1: Prerequisites

Before starting, ensure you have the following:

  • Tableau Desktop: If you don't already have Tableau installed, you can download it from here.
  • Connection String: The MongoDB connection string provided by your database service. It will look something like this:

mongodb://atlas-sql-[id]-yp1td.a.query.mongodb.net/[db]?ssl=true&authSource=admin

Your database provider should supply this, along with the appropriate username and password.


Step 2: Install MongoDB JDBC Driver

MongoDB offers official support for connecting to Tableau via the MongoDB BI Connector. Follow these steps to set up the connection and start visualizing your MongoDB data in Tableau.

  1. Download the MongoDB JDBC Driver Download the latest version of the MongoDB JDBC driver from the official MongoDB documentation. You can find it here. In this case, the most recent version is mongodb-jdbc-2.2.0-all.jar.

MongoDB JDBC Driver Download

MongoDB JDBC Driver Example

  1. Move the .jar File into Tableau Driver folder

After downloading the .jar file, move it to the appropriate directory.

  • Go to the home directory in the Finder app

Open home directory

  • Open Finder and press Shift + Command + . to reveal hidden folders.
  • Navigate to the Library folder.
  • Inside Library, go to Tableau/Drivers.
  • Copy and paste the downloaded .jar file into the Drivers folder.

macOS Drivers Folder

Step 2: Install the Tableau Connector (.taco File)

  1. Download the Tableau Connector (.taco) File The .taco file is required to complete the connection. Download it from here.

Download Tableau Connector

  1. Add the .taco File to Tableau Repository
  • Open Tableau.
  • Navigate to File > Repository Location.

Tableau Repository Location

  • Find and open the Connectors folder in the Tableau repository.
  • Copy and paste the downloaded .taco file into this folder.

Add  raw `.taco` endraw  File to Connectors Folder

Connector Placement in Tableau

Once these steps are completed, MongoDB should appear now in Tableau as an optional connection.

Step 3: Connecting MongoDB to Tableau Using the BI Connector

To connect MongoDB Atlas to Tableau, follow these steps:

MongoDB Atlas Connection Screen

  1. Select MongoDB Atlas by MongoDB from the available options.
  2. Enter your MongoDB URI (ask your database administrator for this information).
  3. Specify the database you want to access (ask your database administrator for this information).
  4. Set Authentication Method: Use Username and Password.
  5. Input Username (ask your database administrator for this information).
  6. Input Password (ask your database administrator for this information).
  7. Click Sign In.

MongoDB Atlas Connection Success

And that's it! You are now successfully connected to your MongoDB database. Congratulations! 🥳🚀

References

Top comments (0)