1. Query filter
The filter object selects documents; $gt matches values greater than 30.
{ age: { $gt: 30 } }Typorithm · easy
Step 1 of 8 · intro card
CRUD
find returns a cursor over all matching documents; findOne returns the first match. Filters use operators like $gt, and limit caps the result count.
find queries a collection with a filter object and returns a cursor you can iterate, limit, or sort.
Filters use comparison operators: { age: { $gt: 30 } } matches documents whose age exceeds 30.
findOne returns a single document (or null) instead of a cursor — convenient when you expect exactly one match.
find returns a cursor over all matches.
findOne returns the first match or null.
Operators like $gt build filters.
db.users.find({ age: { $gt: 30 } })
db.users.findOne({ name: "Ada" })
db.users.find().limit(5)Connect each part of the code to the concept before you type.
The filter object selects documents; $gt matches values greater than 30.
{ age: { $gt: 30 } }find returns a cursor over every matching document.
db.users.find({ age: { $gt: 30 } })findOne returns just the first matching document, or null.
db.users.findOne({ name: "Ada" })limit caps the cursor to at most five documents.
.limit(5)Read the concept map and follow the code breakdown.
Type the implementation, repair mistakes and work through every recall exercise.
Use the final check without hints; revisit weak concepts in short practice sessions.