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

Academy 3T

  • Explore our courses
    • MongoDB 101: Getting Started
    • MongoDB 201: Querying MongoDB Data
    • MongoDB 301: Aggregation
  • Get certified

Lesson 4, Exercise 2: Reviewing the collection in different views

MongoDB 101: Getting Started The MongoDB Basics: Databases, Collections & Documents Lesson 4, Exercise 2: Reviewing the collection in different views

Studio 3T lets you view a collection in Tree View, Table View, and JSON View. In this exercise, you will review the welsh_pubs collection in all three views. You will also update some preferences to make it easier to view documents in Tree View.

To review the collection

1. On the welsh_pubs collection tab, select Table View from the drop-down list in the top right corner of the Result tab.

Table view

Table View displays the document data in a grid that contains one column for each top-level field in the documents:

  • Fields defined with the Object data type show the total number of fields in each embedded document. In this case, three fields contain embedded documents: address, location, and contact. Less than a third of the documents include the contact field.
  • Fields defined with the Array data type show the total number of elements in each array. In this case, no documents include arrays.
  • All other fields display the scalar values. For example, fields might show String values or Int32 values.The following table shows the icons associated with some of the more common data types.
TypeIconDefinition
Array
Array data type icon
Contains a group of elements, which typically are all of the same data type such as an integer or string. An array data type makes it possible to store multiple values in one field. (source)
Date
Date data type icon
Contains date values, time values, or date and time values. (source)
Int32
Int32 data type icon
Represents signed integers with values that range from negative 2,147,483,648 (which is represented by the Int32.MinValue constant) through positive 2,147,483,647 (which is represented by the Int32.MaxValue constant. (source)
Int64
Int64 data type icon
Represents signed integers with values that range from negative 9,223,372,036,854,775,808 (which is represented by the Int64.MinValue constant) through positive 9,223,372,036,854,775,807 (which is represented by the Int64.MaxValue constant. (source)
Object
Object data type icon
Used for embedding documents. Embedded documents are documents embedded in another document in the form of a field-value pair. (source)
ObjectId
ObjectId data type icon
Small, likely unique, fast to generate, and ordered, ObjectId values consist of 12 bytes, where the first four bytes are a timestamp that reflect the ObjectId’s creation. (source)
String
String data type icon
The most commonly used data type. Used to to represent text rather than numbers. It is comprised of a set of characters that can also contain spaces and numbers. (source)

2. Double-click any address value (not the field header) to go one level deeper into the embedded documents for that field.

The grid now displays the individual values of the embedded documents, along with the _id values, as shown in the following figure.

Individual ids

3. To return to the top-level fields in the grid, click the welsh_pubs link in the breadcrumb navigator just above the grid.

Address tab

4. On the Result tab, select Tree View from the drop-down list near the tab’s upper right corner.

Tree view

Tree View displays the document data in a grid that contains three columns—Key, Value, and Type—with each document in its own row.

The Type column refers to the data type, which in this case, is Document.

5. You can use the Studio 3T preferences to control how various elements are displayed.

To open the preferences:

  • In Windows, select Preferences from the Edit menu.
  • In macOS, select Preferences from the Studio 3T menu.

6. Review the options available in the Preferences dialog box.

These settings can help you personalize the interface and make you more productive. For this exercise, select the Auto-expand first document in tree view check box on the General tab, and then click OK.

Prederence tab

7. On the Result tab toolbar, click the Refresh button.

The first document should now be expanded to the first level.

result tab

Notice that the Type column displays the data type of each field. The address and location fields are configured with the Object data type because they contain embedded documents.

8. Click the arrow to the left of the address field.

This expands the field to display the individual fields in the embedded document.

Result tab drop down

9. Expand the arrow to the left of the location field to view the individual geospatial fields.

Location drop down

10. Select JSON View from the drop-down list in the upper right corner.

Studio 3T now displays the documents in the JSON format.

JSON view

In JSON View, you can see the name/value pairs for each field and embedded document. This view is more consistent with how data is added and stored in a MongoDB database.

The figure shows the documents in the Mongo Shell Format, one of the display options available to the JSON View. You can also display the documents in the Simple Format or the Mongoexport Format. To choose a display option, click the settings icon near the tab’s upper right corner and select the appropriate option.

11. Return to Table View and leave the collection open for the next exercise.

Previous Topic
Back to Lesson
Next Topic
  • Course Home Expand All
    Introduction to MongoDB and Studio 3T
    1 Quiz
    Test your skills: Introduction to MongoDB and Studio 3T
    Introduction to MongoDB Atlas
    1 Topic
    Lesson 2, Exercise: Setting up MongoDB Atlas
    Connecting to MongoDB
    1 Topic | 1 Quiz
    Lesson 3, Exercise: Connecting to MongoDB via Studio 3T
    Test your skills: Connecting to MongoDB
    The MongoDB Basics: Databases, Collections & Documents
    7 Topics | 2 Quizzes
    Lesson 4: Understanding MongoDB Documents: Fields & Data Types
    Test your skills: Understanding MongoDB Documents
    Lesson 4: Comparing MongoDB vs SQL Concepts
    Lesson 4, Exercise 1: Creating a collection from a .json file
    Test your skills: Creating a Collection
    Lesson 4, Exercise 2: Reviewing the collection in different views
    Lesson 4, Exercise 3: Using Visual Query Builder to query data
    Lesson 4, Exercise 4: Updating data directly within the collection
    Post-Basics Course Feedback
    Using SQL in MongoDB Aggregation
    3 Topics | 1 Quiz
    Lesson 5, Exercise 1: Running a SQL aggregate query in MongoDB
    Test your skills: Using SQL in MongoDB Aggregation
    Lesson 5, Exercise 2: Exporting a SQL query to the Aggregation Editor
    Lesson 5, Exercise 3: Editing a query in the Aggregation Editor
    Importing and Exporting MongoDB Data
    3 Topics | 1 Quiz
    Lesson 6, Exercise 1: Importing document data from a .csv file
    Lesson 6, Exercise 2: Exporting document data to a .json file
    Lesson 6, Exercise 3: Exporting document data to a new collection
    Test your skills: Importing and Exporting MongoDB Data
    Running MongoDB Queries on the mongo Shell
    4 Topics | 1 Quiz
    Lesson 7: Introducing IntelliShell
    Lesson 7, Exercise 1: Using IntelliShell to load and run a script file
    Lesson 7, Exercise 2: Using IntelliShell’s auto-completion features to write queries
    Lesson 7, Exercise 3: Running queries in IntelliShell and viewing the results
    Test your skills: Running MongoDB Queries on the mongo Shell
    Course Extras
    Return to MongoDB 101: Getting Started
  • 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

    Reddit

    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