MongoDB practice questions you can run in your browser
110 hands-on exercises across 12 topics. Write real find() and aggregate() queries against small, readable collections, run them instantly, and get your answer checked. No signup, nothing to install.
- Answers checked by result, not by text
- A cheat sheet beside every topic
- Progress saved in your browser
Topics
βFinding & Projectionfind, findOne, picking fields, counting, distinct.
β·Comparison Operators$gt, $lt, $gte, $lte, $ne, $in, $nin, $mod.
βLogical Operators$and, $or, $not, $nor β and when you don't need them.
βElement & Type$exists and $type β schema questions on schemaless data.
βPattern Matching$regex β starts with, ends with, contains, case-insensitive.
β
Sort, Limit & SkipOrdering results and paginating them.
β§Array Queries$all, $size, $elemMatch, positional dot paths.
βEmbedded DocumentsDot notation into nested objects and arrays of objects.
βAggregation Basics$match, $project, $addFields, $count, $sort, $limit.
Ξ£Grouping & Accumulators$group with $sum, $avg, $min, $max, $push, $addToSet.
β$unwind & Array PipelinesFlattening arrays so you can group across their elements.
β¦Joins & Advanced Stages$lookup, $facet, $bucket, $replaceRoot, $graphLookup, top-N per group.
How it works
Pick a topic, read its cheat sheet, and answer the questions in a real mongo-shell editor. Your query and the reference solution both run against the same six collections β restaurants, movies, customers, products, orders and employees β and the results are compared, so any query that returns the right documents is accepted however you wrote it.
Read the full MongoDB cheat sheet or browse the sample data.