MongoDB is a document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with optional schemas. qStudio is a free SQL IDE, it allows running SQL scripts, easy browsing of tables, charting and exporting of results. It works on every operating system, with every database including MongoDB Atlas SQL.

Setting up a MongoDB connection in qStudio

Start MongoDB

MongoDB can either be ran locally or you can use MongoDB Cloud. To keep this tutorial simple we opted for cloud. Simply start a small service in your chosen region. Then:

  1. Click on Database page
  2. Click +Create to create a database then for this demo I loaded sample data.
  3. Click Connect.
  4. Find the Atlas SQL option and select JDBC driver.
  5. Copy the JDBC URL
MongoDB Cloud

Connecting to a Server

When you first open qStudio click on the menu options Server->Add Server or on the add server button on the toolbar.
Then set the details:

  1. Server Type: MongoDB
  2. Click URL.
  3. Paste in the URL from Mongo Atlas website.
  4. Enter the username and password.
  5. Click Add.
Add MongoDB Connection

Either when you add the connection or once you try to run code in the code editor, you will be asked to install the driver automatically. Say Yes.

Install JDBC Driver Prompt

Sending Queries

You can run queries by highlighting selected code and pressing Ctrl + e to run that code. See Keyboard Shortcuts.

CommandShortcut
Run highlighted text Ctrl + e
Run Line Ctrl + Enter

This will update your various results panels, result contains your table (excel export etc. supported), charts are generated based on your data and the console summarizes your recent commands

Run MongoDB Select

Well Done!

You have now got qStudio querying your database successfully.

We want to make qStudio the best SQL analysis tool. If you have any problems or want additional features, please post on our github repo.