Skip to main content

Fundamentals for MongoDBs

MongoDB fundamentals cover the document model and the four basic operations. Data lives in BSON documents inside collections inside databases, each with a unique _id. This unit opens the Basics stage and teaches create, read, update and delete operations using insertOne, find, updateOne and deleteOne in the shell.

Stage: Basics · Part of the MongoDB roadmap · Last reviewed 19 November 2026

What to learn in Fundamentals

Fundamentals interview questions

What is the _id field in MongoDB?

Every document has a unique _id that acts as its primary key. If you do not supply one, the driver generates an ObjectId, which embeds a timestamp. The _id is indexed automatically and cannot be changed after the document is inserted.

What is the difference between updateOne and replaceOne?

updateOne modifies only the fields named by update operators such as $set, leaving others untouched. replaceOne swaps the entire document, other than _id, with a new one, so any field you omit is lost. Pick updateOne for partial changes.

Where Fundamentals fits in the MongoDB roadmap

Fundamentals belongs to the Basics stage (beginner level), which takes about 12 hours. Documents and CRUD.

Back to the full MongoDB roadmap