Logical terms let you combine other expressions using Boolean logic. N1QL provides the following logical operators:
In N1QL, logical operators have their usual meaning. However, in any of these expressions, if any operand is MISSING, the value of the expression is MISSING. If any operand is NULL and no operand is MISSING, the value of the expression is NULL. See the description of the OR operator for an exception to this rule.
condition AND condition
AND evaluates to TRUE only if both conditions are TRUE.
condition OR condition
OR evaluates to TRUE if one of the conditions is TRUE.
The OR operator has an exception to the general rule that operators return MISSING or NULL if their operands are MISSING or NULL. If one operand of the OR operator is TRUE and the other operand is MISSING or NULL, the OR operator returns TRUE.
NOT evaluates to TRUE if the expression does not match the condition.