The MongoDB Basics: Databases, Collections & Documents


To understand the MongoDB basics, we need to look at how data is stored in MongoDB.

Data in MongoDB is made up of three types of components: databases, collections, and documents. The database sits at the top of the hierarchy, collections at the next level, and documents at the bottom.

A database provides a container for storing and organizing data.

Each database contains one or more collections, and each collection contains zero or more documents.

A database can contain multiple collections, but a collection cannot span multiple databases. Likewise, a collection can contain multiple documents, but a document cannot span multiple collections.

Studio 3T organizes and presents data elements based on the MongoDB document structure, which makes it a handy tool for understanding that structure.

In the following sections, you’ll apply what you’ve learned from the MongoDB basics and use Studio 3T to create a database and a collection and add documents to the collection, importing the documents from a .json file. You’ll then query the documents, view the results in different views, and then update some of the values.

By the end of this section, you will learn how to:

  • Create a collection from a .json file
  • Review the collection in different views
  • Use Visual Query Builder to query the data
  • Update the data directly within the collection

What you will need:

  • A text editor such as Notepad (Windows) or TextEdit (macOS)
  • Access to a MongoDB Atlas cluster
  • Ability to download a .json file from the Internet
Log in

Log in to your Studio 3T Academy account

Forgot password?

Don't have an account yet? Sign up
Sign up

Start learning MongoDB today. All fields are mandatory.

By signing up for a course, you agree to the 3T Software Labs Privacy Policy.

Already have an account? Log in