MongoDB – Operators:

Types of operators:

1. Conditional Operators
2. Logical Query Operators
3. Element Query Operators
4. Evaluation Query Operators
5. Query Operators
6. Projection Operators

Throughout the Operators notes we will follow the collection data “students” and followed by the example are given below.

Conditional operators are:

$gt:(>)greater than
$lt:(<)less than
$gte:(>=)greater than equal to
$lte:(<=)less than equal to
$ne:(!=) Not Equal to
$in:in
$nin:Not in

Example:

Logical Query Operators: $and: Returns documents that satisfy both conditions
$not: Returns documents that do not satisfy the condition
$or: Returns documents that satisfy either any one of given conditions
$nor: Returns documents that do not satisfy both conditions

Example: