Interactive tutorial

MongoDB Basics: Documents, Collections, and CRUD

Learn how MongoDB organizes data into databases, collections, and documents. Using mongosh on your own computer, you will create sample documents, query and organize results, update selected records, and delete data safely. Finish by completing and verifying a small CRUD workflow.

  • Level: Beginner
  • Duration: approx. 32 min
  • 8 steps
MongoDB Basics: Documents, Collections, and CRUD

What you will go through

  1. Step 1 of 8 3 min Connect and Understand the Data Hierarchy Connect to a local MongoDB server, select the dedicated practice database, and identify how MongoDB data is nested.
  2. Step 2 of 8 3 min Read the Anatomy of a Document Learn to read MongoDB document syntax, identify common BSON-style values, and understand the purpose of a unique `_id`.
  3. Step 3 of 8 4 min Create Documents with Inserts Create the three-book practice dataset with single-document and multiple-document inserts, interpret successful write results, and recognize duplicate-ID protection.
  4. Step 4 of 8 4 min Read Documents with Filters Use mongosh read filters to retrieve exact documents, compare numeric fields, and predict matching results.
  5. Step 5 of 8 4 min Shape and Order Query Results Use projections, sorting, and limits to request a concise, predictable read result from the `books` collection.
  6. Step 6 of 8 5 min Update Selected Documents Safely modify selected MongoDB documents with `$set` and `$inc`, then verify stored values and interpret update-result counts.
  7. Step 7 of 8 4 min Delete Documents Safely Use bounded filters, preview targets, interpret deletion counts, and verify removals in mongosh.
  8. Step 8 of 8 5 min Complete and Verify a CRUD Workflow Complete a safe local CRUD lifecycle for the reserved Garden Starter document and verify each result in mongosh.

Video Courses

Courses related to this topic

See all video courses

Download the App now to have access to + 5000 free courses, exercises, certificates and lots of content without paying anything!

  • 100% free online courses from start to finish

    Thousands of online courses in video, ebooks and audiobooks.

  • More than 60 thousand free exercises

    To test your knowledge during online courses

  • Valid free Digital Certificate with QR Code

    Generated directly from your cell phone's photo gallery and sent to your email

Cursa app on the ebook screen, the video course screen and the course exercises screen, plus the course completion certificate