# MongoDB Atlas at a Glance — MongoDB Fundamentals: Documents, Queries and Indexes

Source: https://www.skillbyai.com/en/mongodb/mongo-atlas

> 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.

```bash
mongosh "mongodb+srv://cluster0.abcde.mongodb.net/myDb" --username ada
```

## Free 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

**Quiz:** What format does MongoDB use to store documents?

- [ ] XML
- [ ] CSV
- [x] BSON
- [ ] YAML

*Answer:* BSON. BSON extends JSON with types such as Date and ObjectId.

## Final quiz 2 of 8

Final quiz

**Quiz:** Which method adds one document?

- [ ] addDoc
- [ ] push
- [ ] create
- [x] insertOne

*Answer:* insertOne. insertOne creates the collection if needed.

## Final quiz 3 of 8

Final quiz

**Quiz:** Which operator appends to an array field?

- [x] $push
- [ ] $set
- [ ] $inc
- [ ] $unset

*Answer:* $push. $push adds a value to an array.

## Final quiz 4 of 8

Final quiz

**Quiz:** What does an IXSCAN in explain() show?

- [ ] A full collection scan
- [x] 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

**Quiz:** When should you embed related data?

- [ ] When it grows without limit
- [ ] When it is shared by many parents
- [x] 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

**Quiz:** What does the $group stage do?

- [ ] Filters documents
- [ ] Deletes documents
- [ ] Renames fields
- [x] 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

**Quiz:** What does a replica set provide?

- [x] 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

**Quiz:** Which problem does sharding mainly solve?

- [ ] Password resets
- [x] Scaling storage and throughput
- [ ] Date formatting
- [ ] Backups only

*Answer:* Scaling storage and throughput. Shards split data across servers by shard key.
