Lesson 22 / 23
MongoDB Atlas at a Glance
Run MongoDB in the cloud with Atlas, get a connection string and practise on the free M0 tier.
A managed database
Atlas is MongoDB's fully-managed cloud service — it handles provisioning, backups, monitoring and scaling for you.
Connecting to an Atlas cluster
Atlas gives you a connection string to use from mongosh or your app's driver.
mongosh "mongodb+srv://cluster0.abcde.mongodb.net/myDb" --username adaFree tier to learn on
The M0 free-tier cluster is enough to practice everything in this course without spending anything.
Final quiz 1 of 8
Final quiz
Quick check: What format does MongoDB use to store documents?
- XML
- CSV
- BSON
- YAML
Answer
BSON — BSON extends JSON with types such as Date and ObjectId.
Final quiz 2 of 8
Final quiz
Quick check: Which method adds one document?
- addDoc
- push
- create
- insertOne
Answer
insertOne — insertOne creates the collection if needed.
Final quiz 3 of 8
Final quiz
Quick check: Which operator appends to an array field?
- $push
- $set
- $inc
- $unset
Answer
$push — $push adds a value to an array.
Final quiz 4 of 8
Final quiz
Quick check: What does an IXSCAN in explain() show?
- A full collection scan
- An index was used
- A syntax error
- An empty result
Answer
An index was used — COLLSCAN is the slow full scan.
Final quiz 5 of 8
Final quiz
Quick check: When should you embed related data?
- When it grows without limit
- When it is shared by many parents
- When it is read together and stays small
- Never
Answer
When it is read together and stays small — Embedding gives one fast read for bounded data.
Final quiz 6 of 8
Final quiz
Quick check: What does the $group stage do?
- Filters documents
- Deletes documents
- Renames fields
- Aggregates documents by a key
Answer
Aggregates documents by a key — $group computes sums, counts and averages per key.
Final quiz 7 of 8
Final quiz
Quick check: What does a replica set provide?
- High availability through copies and failover
- More storage per node
- Schema validation
- Faster inserts
Answer
High availability through copies and failover — A secondary is promoted if the primary fails.
Final quiz 8 of 8
Final quiz
Quick check: Which problem does sharding mainly solve?
- Password resets
- Scaling storage and throughput
- Date formatting
- Backups only
Answer
Scaling storage and throughput — Shards split data across servers by shard key.