MongoDB

Section header image mobile

Coefficient's MongoDB integration lets you easily connect your MongoDB database server and import your data into Google Sheets/Excel. This allows you to analyze your data and curate meaningful charts/dashboards, which will be very helpful to your workflow. 🍃

Connecting to MongoDB

Connect Using a Connection String

Connect using your Username and Password

Import from MongoDB

Import from Collections & Fields

Schedule your Import, Snapshots, and Add Automations

FAQs for MongoDB

Connecting to MongoDB

When you begin a MongoDB import for the first time, you will need to go through a few steps to connect MongoDB as a data source for Coefficient.

There are two options to connect Coefficient to your MongoDB server: 1. Using a Connection String (Recommended) or 2. Entering your credentials (Username and Password). 

Connect Using a Connection String

1. Open the Coefficient Sidebar and click Menu.

MenuIconUpdated.png

2. Select “Connected Sources”.

ConnectedSources.png

3. Select “Add Connection at the bottom and then “Connect” to MongoDB.

Screenshot 2024-04-03 at 12.23.00 AM.png

4. Enter the "Connection string" and "Database name" for your MongoDB server. Click "Connect" when done.

Screenshot 2024-04-03 at 12.41.20 AM.png

ℹ️ NOTE: If you need help finding your "Connection string", click the link under the field, and the following instructions will guide you. 
Link to MongoDB Atlas here

Screenshot 2024-04-03 at 1.07.04 AM.png

5. If your database is behind a firewall, you will need to whitelist whitelist (ALL 3) Coefficient's server IP addresses. (34.217.184.131, 44.234.233.60, 52.32.132.51). Click "Connect" when done.

Screenshot 2024-04-03 at 1.01.39 AM.png

6. You will then be presented with the option to share this connection with other members of your team who also use Coefficient. Your credentials will NOT be shared with your team.  🎉

Screenshot 2024-04-03 at 1.04.08 AM.png

Connect using your Username and Password

ℹ️  NOTE: Coefficient will need the following information: Host, Port, Database Name, Username, and Password when setting up your MongoDB connection. (The default MongoDB port is 27017)

1. Open the Coefficient Sidebar and click Menu.

MenuIconUpdated.png

2. Select “Connected Sources”.

ConnectedSources.png

3. Select “Add Connection at the bottom and then “Connect” to MongoDB.

Screenshot 2024-04-03 at 12.23.00 AM.png

4. Enter the required fields (Host, Port, Database name, Username, Password).

Screenshot 2024-04-03 at 6.59.44 PM.png

5. If your database is behind a firewall, you will need to whitelist (ALL 3) Coefficient's server IP addresses. (34.217.184.131, 44.234.233.60, 52.32.132.51). Click "Connect" when done.

Screenshot 2024-04-03 at 1.01.39 AM.png

6. You will then be presented with the option to share this connection with other members of your team who also use Coefficient. Your credentials will NOT be shared with your team.  🎉

Screenshot 2024-04-03 at 1.04.08 AM.png

Import from MongoDB

When importing data from MongoDB, the database tables are called "Collections". Let's create your first MongoDB import together. 

Import from Collections & Fields

1. From the Sidebar select “Import from…”.

ImportFrom (1).png

2. Choose “MongoDB” from the list.

3. Select "From Collections & Fields".

Screenshot 2024-04-03 at 7.06.54 PM.png

4. The Import Preview window opens, showing all the available collections from your MongoDB server (based on permissions). Select the collection for your import. (eg. ”listingAndReviews”)Screenshot 2024-04-03 at 7.12.39 PM.png

5. Once the collection is selected, the fields within that collection will appear in a list on the left side of the Import Preview window. Select the fields you want to include in your import by checking/unchecking the corresponding boxes.
ℹ️ NOTE: The Import Preview shows only a sample of your data (50 rows). This sample data will be updated if there are any changes to the import's criteria.Screenshot 2024-04-03 at 7.42.45 PM.png

6. Customize your import by adding filters, sorts, and limits. Then, "Import" when done.Screenshot 2024-04-03 at 8.09.56 PM.png

7. Congratulations on your first MongoDB import with Coefficient! 🍃Screenshot 2024-04-03 at 8.19.58 PM.png

Schedule your Import, Snapshots, and Add Automations

Once you have pulled your data into your spreadsheet using Coefficient, you can set up the following:

1. Schedule your Import

Scheduled_Refreshes.png

2. Turn on Snapshots

Snapshot.png

 

3. Set Up Automations

AutomationswithGPT.png

FAQs for MongoDB

How does the MongoDB connector function? Is its operation similar to that of traditional SQL connectors such as MySQL and MS SQL?

MongoDB is a NoSQL database that lacks a fixed schema, necessitating a structured mapping for formats like spreadsheets. We accomplish this by scanning the initial 1,000 records and consolidating unique keys into columns. However, any new field introduced beyond the 1,000th record will not be automatically included in our output. The team is looking to build support for users to enable them to configure their own fields in the future.

I keep getting an error when I try to connect the MongoDB server to Coefficient. What should I do?

There are a few things to try in this instance: 

  1. Ensure you have the correct Connection String or entered the right Hostname, Database Name, Username, Password, and Port for your MongoDB instance.
  2. If your database is behind a firewall, you will need to whitelist all (3) of our IP Addresses.
    • 34.217.184.131
    • 44.234.233.60
    • 52.32.132.51
  3. Ensure that your MongoDB server and port are set to accept remote connections and are not just listening for incoming connections from localhost. Make sure that your server is accessible from the outside (internet) and not only hosted from your local PC/machine. This may require that you reach out to your MongoDB Server Admin to update some of your database settings.

Do you support nested objects for MongoDB?

Nested objects are not currently supported. If you import from a nested object, the data is presented in JSON format inside the parent field.

 

Was this article helpful? 0 out of 0 found this helpful