Try Studio 3T for Free

How to Query MongoDB

Whether you’re a seasoned professional or a rough-around the edges rookie, querying in MongoDB has never been easier. Studio 3T offers the following ways to query MongoDB:

  • via SQL
  • the mongo Shell
  • through the Aggregation Editor
  • and lastly, the Visual Query Builder

Make use of the Visual Query Builder or write your query in SQL. Create an aggregate query in the Aggregation Editor or use the revamped IntelliShell to navigate through your data!

Check out these guides for specific query functions in Studio 3T:

Visual Query Builder – Drag, Drop, and Query

The Visual Query Builder is the easiest way to begin querying.

If you’re new to MongoDB, use the Visual Query Builder to drag and drop fields, so you can run your very first query even without knowing MongoDB query syntax.

And even if you’re an experienced MongoDB user, you can still use the Visual Query Builder to query arrays or build more complex queries.

View the full Visual Query Builder documentation.

SQL Query – The Familiarity of SQL in MongoDB

If you’re a SQL expert transitioning to MongoDB, you’ll feel right at home with the SQL Query feature.

Write the same familiar SQL inner and left joins and expressions like SELECT, SELECT DISTINCT, ORDER BY, GROUP BY – and much more – to query MongoDB.

Here’s the comprehensive guide to using SQL in MongoDB

IntelliShell – The Responsive mongo Shell

For those accustomed to working in the mongo shell, Studio 3T offers IntelliShell – a mongo shell with auto-completion of JavaScript functions, command helpers, and much, much more.

Here’s the full IntelliShell documentation.

Aggregation Editor – The MongoDB Aggregation Query Builder

Instead of writing complex aggregation queries in the mongo shell, the Aggregation Editor lets you build them one stage at a time for easier debugging.

Want to start creating your first aggregation query? Here’s a tutorial that uses real-life data from the city of Chicago.

 

Updated on July 30, 2019

Was this article helpful?

Related Articles