Skip to main content

Why is MongoDB called a document-oriented database?

Because MongoDB stores data as documents, not table rows. Each document is a JSON-like object (BSON) with its own structure that fully describes an entity.

The core idea of the document approach

  • data is stored as self-contained documents (e.g. a user with all its nested fields)
  • documents are grouped into collections (analogous to tables, but with no rigid schema)
  • different documents within the same collection can have different sets of fields

An example document in MongoDB:

json
{ "name": "Alice", "age": 25, "skills": ["mongo", "node"], "address": { "city": "Berlin", "street": "Main St" } }

Why this is convenient

  • nested structures can be stored right inside the document (no JOIN needed)
  • the data model is easy and fast to change
  • one document = one entity in the application (a good fit for the JSON world of the web and APIs)

Summary: MongoDB is called document-oriented because its basic storage unit isn't a table row, it's a document representing an entire entity in a JSON structure.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.