Skip to content
Studio 3T - The professional GUI, IDE and client for MongoDB
  • Tools
    • Aggregation Editor
    • IntelliShell
    • Visual Query Builder
    • Export Wizard
    • Import Wizard
    • Query Code
    • SQL Query
    • Connect
    • Schema Explorer
    • Compare
    • SQL ⇔ MongoDB Migration
    • Data Masking
    • Task Scheduler
    • Reschema
    • More Tools and Features
  • Solutions
  • Resources
    • Knowledge Base
    • MongoDB Tutorials & Courses
    • Tool/Feature Documentation
    • Blog
    • Community
    • Testimonials
    • Whitepapers
    • Reports
  • Contact us
    • Contact
    • Sales Support
    • Feedback and Support
    • Careers
    • About Us
  • Store
    • Buy Now
    • Preferred Resellers
    • Team Pricing
  • Download
  • My 3T
search

Studio 3T Knowledge Base

  • Documentation
  • Tutorials
  • Workshops
Take the fastest route to learning MongoDB. Cover the basics in two hours with MongoDB 101, no registration required.
Start the free course

Collection Tab

Posted on: 28/04/2018 (last updated: 08/10/2021) by Dakota Karlsson
tl;dr
Shortcuts

The Collection Tab is the starting point for all MongoDB data exploration and analysis in Studio 3T. Here, access can be found to the Visual Query Builder, the Main Query Bar, and the other features associated with the current collection. Try it today.

Tab Content

The Collection Tab shows the contents of a MongoDB collection. It’s made up of the Visual Query Builder, the Main Query Bar, the Results Tab, the Results Tab Toolbar, the Query Code tab, and the Explain tab.

The Collections Tab in Studio 3T.

In the above screenshot, Customers is a collection whose documents are shown in the Collection Tab, indicated by the green border. Download the Customers collection to follow along the tutorial.

Visual Query Builder

The Visual Query Builder lets users create MongoDB queries via drag and drop. Simply drag the desired field(s) to the query builder, drop it, set the operators, and run the query. It supports all MongoDB operators and field values.

As the query is built in the Visual Query Builder, the equivalent query will be displayed in the Main Query Bar in the mongo shell syntax

Read about the Visual Query Builder in full.

Main Query Bar

The Main Query Bar will show the query as it is built in the Visual Query Builder.

The Main Query Bar mirrors the query being built in the Visual Query Builder in JSON format which users can edit. It includes the Query, Projection, Sort, Skip, and Limit fields.

This tool is especially useful for the experienced developer, but also helps new users gain familiarity with reading and using JSON to build queries.

The Query Bar supports four short-hand query options to search by _id:

  • ObjectId (either single or double quoted). If the user enters 
57d28452ed5d4d54e8686f9d

into the query text field, it will be auto-expanded to

{ "_id" : ObjectId("57d28452ed5d4d54e8686f9d") }
  • UUID (either single or double quoted). If the user enters
C37E3CBA-8FAF-4923-818A-09D92AB56182

into the query text field, it will be auto-expanded to

{ "_id" : UUID("C37E3CBA-8FAF-4923-818A-09D92AB56182") }
  • Integer. If the user enters
9876543210

into the query text field, it will be auto-expanded to

{ "_id" : 9876543210 }
  • A single or doubled quoted string. If the user enters
"2020-12-12"

into the query text field, it will be auto-expanded to

{ "_id" : "2020-12-12" }

The Query JSON Editor (“Multi-line Editor Tool”)

While the Main Query Bar only shows parts of a query, the Query JSON Editor displays the entire query in JSON. Here users can edit queries exactly how it would be done in the mongo shell.

To open the Query JSON Editor, click the button to the left of the ‘play’ symbol in the Main Query Bar.

Edit your query directly by clicking the Query JSON Editor button.

Double-check the code and click ‘Validate’ to ensure the query is being built correctly.

The Run Query Button (“Play”)

Sitting directly to the right of the Query JSON Editor button, the Run (‘Play’) button runs the query on the respective collection. Additionally, this button contains a dropdown menu housing two other operations:

  • “findOne(..)” – returns a single entry matching query
  • “count(…)”. – will return the number of documents matching the query
The 'Execute' or 'Run Query' Button in Studio 3T

Next to the Run button you’ll find a broom icon in the Query Bar. This will clear the query, projection, sort, skip, and limit parameters in one click.

Just above the Run Query and Query JSON Editor buttons are three additional buttons: Search Query History, Bookmark Query Manager,  and Copy Query to Clipboard.

Search Query History

Shows all previous that have been run. Queries are shown in JSON view.

Bookmark Query Manager

Saves oft-used queries and eliminates the need to repeatedly enter queries manually.

Copy Query to Clipboard

Copies the query automatically to the users’ clipboard.

Results Tab

The Results Tab offers three different options to view results and edit data: Tree View, Table View, and JSON View.

Swtich button Tree, Table, and JSON view

Tree View

Tree View allows for users to see the hierarchies in the data. Additionally, data can be edited in-place. Read more about Tree View.

Table View

Table View sorts data into columns and rows similar to a spreadsheet and enables custom views of embedded fields and sub-fields. As with Tree View, in-place editing is also available. Find full documentation of Table View here.

JSON View

JSON View shows the data as JSON documents.

Drag-and-drop query building is not available while in JSON View. However, for fast in-place editing, select the target value and Cmd-J will bring up the JSON editor panel. Read about JSON view here.

In-Place Data Editing

In-place editing is available throughout Studio 3T.  All three views – Table, Tree, and JSON – allow for data editing in real-time.

In Tree and Table View, this is done by double-clicking on any field. Additionally, a multi-line editor can be opened by clicking on the ellipsis icon.

In JSON View, right-click anywhere in the Results Tab and choose Document > Edit Document. This will open the Document JSON Editor.

The Results Tab Toolbar

The Results Tab toolbar.
Arrow keys

Use the arrow keys to flip through various results pages.

Results per page

Choose to see 1, 10, 20, 50, or 100 results per page

Refresh Documents

Click the refresh/recycle symbol to refresh results.

Add Document

Creates a new object and allows users to input new data for the corresponding field.

View Document

Opens the current document in JSON view.

Edit Document

Opens the document in JSON editor.

Show Update Dialog

Opens a dialog screen where users can edit update settings.

Show Remove Dialog

Removes documents/fields matching a certain criteria.

Document Count in One Click

To count results, click the Count Documents button on the bottom right hand corner. This returns the number of documents which match the query, in one click.

Update Dialog

The Update Dialog is a pop-up editor within the Collection Tab that allows you to modify several documents at once. It is equivalent to the db.collection.updateMany() command in MongoDB.

To access the Update Dialog, right-click on any cell in Table View or Tree View and choose Update Dialog.

It has two tabs: Query and Update.

The Query tab is where you write the query to find the documents you want to update.

You can choose to apply one of three predefined queries (all documents in the collection, selected documents in the collection, or the current results from the Collection View), but you can customize the query as needed in the editor.

The Query tab of the Update Dialog

The Update tab is where you write the command that you want to run against your target documents, which you defined in the Query tab.

The Update tab in the Update Dialog

Once done, click Validate JSON to debug, and click Update to finalize.

Query Code

The Query Code tab allows user to convert queries into several different languages. The copy query to clipboard button will copy the code in the target language, thus allowing users to paste driver code easily into their desired application. Currently the languages supported are: mongo Shell, JavaScript (Node.js), Java (2.x driver API), Java (3.x driver API), C#, and Python.

The Query Code tab will display queries in: mongo shell, JavaScript, Java C#, and Python.

Explain Tab

The Explain tab is one of the most powerful methods of fine-tuning query performance – it reveals how the query executes at the line level.

Older Studio 3T versions showed the query plan and execution statistics in this tree view:

The Explain tab gives an in-depth view into query performance.

With the release of Studio 3T 2018.6 came Visual Explain, a feature which outlines the same information in an easier-to-follow diagram format.

Full mode displays stages and runtime statistics, but might cause a delay

Learn more about Visual Explain in full here, and how you can use it to optimize MongoDB query performance.


How helpful was this article?
This article was hideous
This article was bad
This article was ok
This article was good
This article was great
Thank you for your feedback!

About The Author

Dakota Karlsson

New to the world of databases, Dakota hails from a rural town in Texas and is learning just how exciting databases can be. After brief stops in the Big Sky state and a few years in Scandinavia, he now calls Berlin home and spends his spare time involved in the Berlin music scene and experiencing the art of German cuisine.

Article navigation

Related articles

  • How to Copy a MongoDB Collection to Another Database
  • Working with MongoDB Collections: CRUD, Count, Sort, Limit Collection Size & More
  • MongoDB Atlas Tutorial: Set Up a Free Tier Cluster & Import Your First Collection
  • Test your skills: Creating a Collection
  • Lesson 1, Exercise 1: Adding a document to a collection

Studio 3T

MongoDB Enterprise Certified Technology PartnerSince 2014, 3T has been helping thousands of MongoDB developers and administrators with their everyday jobs by providing the finest MongoDB tools on the market. We guarantee the best compatibility with current and legacy releases of MongoDB, continue to deliver new features with every new software release, and provide high quality support.

Find us on FacebookFind us on TwitterFind us on YouTubeFind us on LinkedIn

Education

  • Free MongoDB Tutorials
  • Connect to MongoDB
  • Connect to MongoDB Atlas
  • Import Data to MongoDB
  • Export MongoDB Data
  • Build Aggregation Queries
  • Query MongoDB with SQL
  • Migrate from SQL to MongoDB

Resources

  • Feedback and Support
  • Sales Support
  • Knowledge Base
  • FAQ
  • Reports
  • White Papers
  • Testimonials
  • Discounts

Company

  • About Us
  • Blog
  • Careers
  • Legal
  • Press
  • Privacy Policy
  • EULA

© 2023 3T Software Labs Ltd. All rights reserved.

  • Privacy Policy
  • Cookie settings
  • Impressum

We value your privacy

With your consent, we and third-party providers use cookies and similar technologies on our website to analyse your use of our site for market research or advertising purposes ("analytics and marketing") and to provide you with additional functions (“functional”). This may result in the creation of pseudonymous usage profiles and the transfer of personal data to third countries, including the USA, which may have no adequate level of protection for the processing of personal data.

By clicking “Accept all”, you consent to the storage of cookies and the processing of personal data for these purposes, including any transfers to third countries. By clicking on “Decline all”, you do not give your consent and we will only store cookies that are necessary for our website. You can customize the cookies we store on your device or change your selection at any time - thus also revoking your consent with effect for the future - under “Manage Cookies”, or “Cookie Settings” at the bottom of the page. You can find further information in our Privacy Policy.
Accept all
Decline all
Manage cookies
✕

Privacy Preference Center

With your consent, we and third-party providers use cookies and similar technologies on our website to analyse your use of our site for market research or advertising purposes ("analytics and marketing") and to provide you with additional functions (“functional”). This may result in the creation of pseudonymous usage profiles and the transfer of personal data to third countries, including the USA, which may have no adequate level of protection for the processing of personal data. Please choose for which purposes you wish to give us your consent and store your preferences by clicking on “Accept selected”. You can find further information in our Privacy Policy.

Accept all cookies

Manage consent preferences

Essential cookies are strictly necessary to provide an online service such as our website or a service on our website which you have requested. The website or service will not work without them.

Performance cookies allow us to collect information such as number of visits and sources of traffic. This information is used in aggregate form to help us understand how our websites are being used, allowing us to improve both our website’s performance and your experience.

Google Analytics

Google Ads

Bing Ads

Facebook

LinkedIn

Quora

Hotjar

Functional cookies collect information about your preferences and choices and make using the website a lot easier and more relevant. Without these cookies, some of the site functionality may not work as intended.

HubSpot

Social media cookies are cookies used to share user behaviour information with a third-party social media platform. They may consequently effect how social media sites present you with information in the future.

Accept selected