MongoDB
Last updated
Last updated
You can quickly import data from your MongoDB into Exploratory.
In Exploratory, there are three types of MongoDB connections.
Connection string
Single Host
Multiple Hosts
If you want to connect to your MongoDB with DNS Seedlist Connection Format or if you already have a working MongoDB Connection String, you can use this "Connection String" type. Simply copy and paste the Connection String to the text area and click the Test Connection button. If the connection test went well, click the Add button to save it.
You can find MongoDB connection Sting details here.
If you prefer to connection to your MongoDB by supplying Host, Port, Database, Username, and Password from the Connection Dialog, you can use this "Single Host" type. Like other Database connections, type in required fields then click Test Connection button. If the connection test went well, click Add to save it.
If you prefer to connection to your MongoDB (Sharded Cluster) by supplying Cluster, Database, Username, and Password from the Connection Dialog, you can use this "Multiple Hosts" type. Type in Cluster and other required fields, then click the Test Connection button. If the connection test went well, click Add button to save it.
Click '+' button next to 'Data Frames' and select 'Import Database Data'.
Click MongoDB to select.
Select connection from left dialog box.
Select collection from left dialog box. Then you will see the preview of the data.
You can use Input Parameters to fine tune your query result.
See An Introduction to MongoDB Query for Beginners for each Input Parameter details.
Query - You can set the filtering condition.
Fields - You can select the columns (or fields) by either keeping them or excluding them explicitly.
Sort - You can use this to set the sorting rules.
Limit - 100 by default, which means it will query only the first 100 rows (documents) of the data. You can change this to other values and eventually you want to set it to ‘All’ once you finalize your queries and are ready for importing the data into Exploratory.
The aggregation pipeline has an internal optimization phase that provides improved performance for certain sequences of operators. For details, see Aggregation Pipeline Optimization
First, click Parameter link on the MongoDB Data Import Dialog.
Second, define a parameter and click Save button.
Finally, you can use @{} to surround a variable name inside the query like below.
If you type @ then it suggests parameters like below. And now it shows restaurants in Manhattan.
Here's a blog post for more detail.
If it looks ok, then you can click 'Import' to import the data into Exploratory.