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
1️⃣ $eq — Equal To
Example02
2️⃣ $ne — Not Equal To
Example03
3️⃣ $gt — Greater Than
Example04
4️⃣ $gte — Greater Than or Equal To
Example05
5️⃣ $lt — Less Than
Example06
6️⃣ $lte — Less Than or Equal To
Example07
7️⃣ $in — Matches Any Value in an Array
Example08
8️⃣ $nin — Does Not Match Any Value in an Array
Example09