let x
=>
.map()
<div>
color: teal
______
______
Theebug
Theebug — Learn to Code by Doing
Light
Start Learning
Explorer
···
▼
THEEBUG
index.tsx
learn.md
docs.md
about.md
faq.md
leaderboard.md
updates.md
learn.md
THEEBUG
›
learn.md
Browse more courses
MongoDB
Documents, queries, updates, and aggregation — the database Theebug itself runs on.
Start Course
Beginner
3 levels
01 — lesson1.js
easy
Inserting a Document
1
const result = await users.[ ___ ]({ name: "Ada", age: 30 });
2
console.log(result.insertedId);
Insert a single new user document into the collection
Play
02 — lesson2.js
easy
Finding Documents
1
const user = await users.[ ___ ]({ name: "Ada" });
2
console.log(user);
Find the single user document matching this filter
Play
03 — lesson3.js
easy
Query Operators
1
const adults = await users.find({ age: { [ ___ ]: 18 } }).toArray();
Find every user whose age is 18 or greater
Play
Intermediate
2 levels
04 — lesson4.js
medium
Updating Documents
1
await users.updateOne({ name: "Ada" }, { [ ___ ]: { age: 31 } });
Update Ada's age to 31 using the correct update operator
Play
05 — lesson5.js
medium
Deleting Documents
1
await users.[ ___ ]({ name: "Ada" });
Delete the single user document matching this filter
Play
Advanced
1 level
06 — lesson6.js
hard
Aggregation Pipeline
1
const totals = await orders
2
.aggregate([
3
{ $group: { _id: "$userId", total: { [ ___ ]: "$amount" } } },
4
])
5
.toArray();
Sum each user's order amounts using the aggregation pipeline's group ope…
Play
main
UTF-8
Markdown