Skip to content
Learn Netverks

Lesson

Step 2/36 6% through track

what-is-mongodb

What is MongoDB?

Last reviewed Jun 1, 2026 Content v20260601
Track mode
none
Means
Read / quiz
Reading
~2 min
Level
beginner

This lesson

This lesson teaches What is MongoDB?: document modeling, query operators, and aggregation patterns for MongoDB.

Teams query What is MongoDB? on every MongoDB codebase—skipping it leaves gaps in debugging and data reviews.

You will apply What is MongoDB? in contexts like: Content catalogs, event logs, mobile sync backends, and polyglot stacks beside SQL services.

Copy JavaScript shell queries from each lesson into mongosh or MongoDB Atlas Data Explorer—inspect matched documents and explain plans. The in-browser lab (execution_profile: none) ships later; mongosh is the practice path now.

After you understand JSON and SQL trade-offs—when document flexibility outweighs relational joins.

MongoDB is a client/server document database. A mongod process stores data; clients (mongosh, drivers in Python/Node) send commands over the wire.

Core characteristics

  • Document model — nested JSON-like structures map cleanly to app objects
  • Flexible schema — documents in one collection can differ (within validator rules)
  • Rich queries — operators on fields, arrays, and embedded objects
  • Aggregation pipeline — multi-stage analytics without always exporting to SQL
  • Horizontal scale — sharding for very large datasets (preview later)

Hierarchy: cluster → database → collection → document

show dbs
use practice
show collections
db.users.findOne()

A deployment hosts databases; each database has collections; each document has an _id (often ObjectId).

Practice: Copy queries into mongosh, MongoDB Atlas Data Explorer, or Compass. Use a database named practice you create for learning.

Who uses MongoDB?

Common in content platforms, catalogs, mobile backends, event logs, and polyglot stacks (SQL for ledger, Mongo for product JSON). Pair with Python (PyMongo) and Node.js (Mongoose).

Important interview questions and answers

  1. Q: BSON vs JSON?
    A: BSON is binary JSON with extra types (Date, ObjectId, Decimal128)—what MongoDB stores on disk.
  2. Q: Is MongoDB schemaless?
    A: Schema-flexible, not schema-less—you should still design fields, indexes, and validators intentionally.

Self-check

  1. Name the four levels from deployment down to document.
  2. What field uniquely identifies a document by default?

Tip: Remember cluster → database → collection → document when reading shell output.

Interview prep

BSON vs JSON?
BSON adds types like ObjectId and Date; MongoDB stores BSON on disk.
Default _id?
ObjectId generated on insert when omitted.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • BSON vs JSON?
  • 16 MB limit?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump