MongoDB Exercises
Apply your knowledge with interactive coding challenges. Complete these 52 MongoDB exercises to master the language.
52
Total Challenges
0
Completed
52
Remaining
0% Complete
Find All Documents
Retrieve all documents from the users collection.
MONGODB Exercise: Collections
Practice Collections in mongodb with this interactive exercise.
Find One Document
Find a single user whose name is "Alice".
MONGODB Exercise: Databases
Practice Databases in mongodb with this interactive exercise.
Insert a Document
Insert a new user with age 30.
MONGODB Exercise: Queries
Practice Queries in mongodb with this interactive exercise.
Update a Document
Update a user's age.
MONGODB Exercise: Updates
Practice Updates in mongodb with this interactive exercise.
Delete a Document
Delete a user by ID.
MONGODB Exercise: Deletions
Practice Deletions in mongodb with this interactive exercise.
Greater Than ($gt)
Find users older than 18.
MONGODB Exercise: Indexes
Practice Indexes in mongodb with this interactive exercise.
Less Than ($lt)
Find products cheaper than 50.
MONGODB Exercise: Aggregation
Practice Aggregation in mongodb with this interactive exercise.
IN Operator ($in)
Find users from specific cities.
MONGODB Exercise: Replication
Practice Replication in mongodb with this interactive exercise.
Check Field Existence ($exists)
Find documents that have a phone number.
MONGODB Exercise: Sharding
Practice Sharding in mongodb with this interactive exercise.
Logical Operators ($or)
Find users under 18 OR over 65.
MONGODB Exercise: Documents
Practice Documents in mongodb with this interactive exercise.
Incrementing Values ($inc)
Increase product views by 1.
MONGODB Exercise: Collections
Practice Collections in mongodb with this interactive exercise.
Remove a Field ($unset)
Remove the temporary field.
MONGODB Exercise: Databases
Practice Databases in mongodb with this interactive exercise.
Add to Array ($push)
Add a new skill to a user.
MONGODB Exercise: Queries
Practice Queries in mongodb with this interactive exercise.
Remove from Array ($pull)
Remove a specific tag.
MONGODB Exercise: Updates
Practice Updates in mongodb with this interactive exercise.
Basic Projection
Return only the name field.
MONGODB Exercise: Deletions
Practice Deletions in mongodb with this interactive exercise.
Sorting Results
Sort products by price.
MONGODB Exercise: Indexes
Practice Indexes in mongodb with this interactive exercise.
Pagination (Limit and Skip)
Get page 2 (10 items per page).
MONGODB Exercise: Aggregation
Practice Aggregation in mongodb with this interactive exercise.
Aggregation: $match
Filter documents in a pipeline.
MONGODB Exercise: Replication
Practice Replication in mongodb with this interactive exercise.
Aggregation: $group
Group by city and count users.
MONGODB Exercise: Sharding
Practice Sharding in mongodb with this interactive exercise.
Aggregation: $lookup (Joins)
Join orders with users.
MONGODB Exercise: Documents
Practice Documents in mongodb with this interactive exercise.
Aggregation: $unwind
Deconstruct an array field.
Node/Express: Fetching Data
Complete the Express route.
Node/Express: Inserting Data
Complete the POST route.
Data Modeling: Embedding
Design a document with embedded address.
Create an Index
Create an index to speed up email queries.
Create a Unique Index
Ensure emails are unique.
Query Performance
Analyze query performance.
Array Elements ($elemMatch)
Match multiple conditions inside an array.
Array Size ($size)
Find users with exactly 3 skills.
Transactions (Session)
Pass the session to an operation.
Aggregation: $sort
Sort documents in a pipeline.
Rename a Field ($rename)
Rename a field across documents.