← MongoDB learning path
MongoDB · Module 3 of 10

Query operators

Filter documents with comparison and logical operators.

📖 Key ideas

  1. Comparison: $gt, $gte, $lt, $lte, $ne, $in.
  2. Logical: $and, $or, $not.
  3. Nested fields: { "address.city": "Chennai" }.
  4. Arrays: { tags: "mongo" } matches arrays containing it.
  5. sort, limit and skip shape results.
💡 Real-life example: Query operators are filters on a shopping site: price above, brand in, rating at least.
$gtGreater than
$inMatches any value in a list
$orEither condition
Dot notationAccesses nested fields