Nearby lessons

10 of 22

⚖️ MongoDB: Comparison Operators

MongoDB comparison operators allow you to filter documents based on specific conditions. These operators compare field values such as equality, inequality, greater than, less than, and more.

📚 Initial Data Setup

Example01
Loading editor…

1️⃣ $eq — Equal To

Example02
Loading editor…

2️⃣ $ne — Not Equal To

Example03
Loading editor…

3️⃣ $gt — Greater Than

Example04
Loading editor…

4️⃣ $gte — Greater Than or Equal To

Example05
Loading editor…

5️⃣ $lt — Less Than

Example06
Loading editor…

6️⃣ $lte — Less Than or Equal To

Example07
Loading editor…

7️⃣ $in — Matches Any Value in an Array

Example08
Loading editor…

8️⃣ $nin — Does Not Match Any Value in an Array

Example09
Loading editor…

Finished this lesson?

Mark it as complete to track your progress and see technology completion stats.