Skip to content
Justice Tech School

Comparison Operators

$eq, $ne, $gt, $gte, $lt, $lte, $in and $nin.

Example
db.users.find({ age: { $gt: 25 } })
db.users.find({ age: { $gte: 20, $lt: 30 } })
db.users.find({ name: { $in: ["Ada", "Kofi"] } })

Exercise

Greater than.

{ age: { : 25 } }

Quiz Test

Which means not in a list?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.