Menu

MongoDB Boolean Operators

MongoDB provides $and, $or, and $not operators for logical conditions in queries and aggregation pipelines. Browse their syntax and examples below.

  1. $and

    The MongoDB $and operator is used to combine multiple conditions to form a logical “AND” relationship.
  2. $not

    The $not operator is an operator in the MongoDB query language that is used to negate a query condition in a query.
  3. $or

    The $or operator is an operator in MongoDB used to perform logical OR operations on multiple conditions.