Intro
MongoDB is an open-source document-oriented database system that stores structured data as JSON-like documents with dynamic schemas. Domo provides connectors that allow you to pull data from a MongoDB collection and compile custom reports.- The MongoDB connector uses Java driver version 3.2.1, and supports Find and Aggregate query methods. You need to enter the Collection name manually in the MongoDB connector.
- The MongoDB Advanced connector uses Java driver version 3.2.1, and supports a plain JSON query. You need to enter the Collection name manually in the MongoDB Advanced connector.
- The MongoDB V2 connector uses Java driver version 3.12.1, and supports Find and Aggregate query methods. You can either select the Collection name from the drop down or enter it manually in the MongoDB V2 connector. Also, MongoDB V2 connector doesn’t require a CA certificate.
- The MongoDB SSH Connector uses Java driver version 3.12.1, and supports Find and Aggregate query methods. You can either select the Collection name from the drop down or enter it manually in the MongoDB SSH connector. You need your SSH credentials (host, port, username, and password) to pull data from a MongoDB collection through an SSH tunnel.
Prerequisites
To connect to your MongoDB SSH account and create a DataSet, you must have the following:- The username and password you use to log into SSH Host
- The SSH host you wish to tunnel through
- The port number of your SSH host
- The SSH private key or SSH password
- The username and password you use to log into your MongoDB database
- The host name for the database server (e.g. db.company.com ).
- The port number for the database
- The database name
Note: Domo does not support the SSH keys generated using ssh-keygen. The SSH keys need to be the DES or RSA keys (in PEM format) generated by OpenSSL.
Connecting to Your MongoDB Collection
This section enumerates the options in the Credentials and Details panes in the MongoDB SSH Connector page. The components of the other panes in this page, Scheduling and Name & Describe Your DataSet, are universal across most connector types and are discussed in greater length in Adding a DataSet Using a Connector.Credentials Pane
This pane contains fields for entering credentials to connect to a collection within a MongoDB database. The following table describes what is needed for each field:Field | Description |
|---|---|
| SSH Host | The SSH host you wish to tunnel through. For example, dmz.mydomain.com |
| SSH Port | The port number of your SSH host |
| SSH Username | The username you use to log into SSH Host |
| SSH Password | The password you use to log into SSH Host |
| SSH Private Key | The SSH private key or SSH password |
| MongoDB Host | Enter the host name for the MongoDB database. For example- db.company.com |
| MongoDB Port | Enter the port number for the MongoDB database |
| MongoDB Database | Enter the name of the MongoDB database |
| MongoDB Username | Enter your MongoDB username |
| MongoDB Password | Enter your MongoDB password |
Details Pane
In this pane you create a JSON query to pull data from your MongoDB collection. You can also create optional WHERE, SELECT, GROUP, and SORT clauses, and apply the query filter to find documents in the collection, also in JSON format.Menu | Description |
|---|---|
| How would you like to select your collection name? | Select how would you like to get the collection name (whether by entering it manually or selecting it from a drop down.) |
| Which database would you like to use to get the data? |
|
| Enter Database Name | Enter the name of the MongoDB database that you would like to connect. |
| Query Method | Select a query method to pull data from your MongoDB collection. |
| Find | A JSON Query will execute by ‘Find Method’. |
| Aggregate | A JSON Query will execute by ‘Aggregate Method’. |
| JSON Query Filter | Enter the query filter to find documents in the collection. |
| Limit Row | Enter the number of rows you want to be returned. |
| Batch Size | Batch size is the number of documents to be returned per batch which is used internally by the connector. Enter the batch size greater than 1. |
| Query Type | Select which query filter to be used to aggregate documents in the collection. |
| Enter Query Filter | Select “Enter Query Filter” to manually enter the JSON Aggregate Query Filter. |
| JSON Aggregate Query Filter | Enter the query filter to aggregate documents in the collection. |
| Custom Query Clause | Select “Custom Query Clause” to aply the custom clauses such as where clause, select clause, group clause, and sort clause. |
| Where Clause JSON | Enter a WHERE clause in JSON format. |
| Select Clause JSON | Enter a SELECT clause in JSON format. |
| Group Clause JSON | Enter a GROUP clause in JSON format. |
| Sort Clause JSON | Enter a SORT clause in JSON format. |
| Enter collection name | Enter the name of the MongoDB collection. |
| Select collection name | Select the name of the MongoDB collection. |