DocumentDB LogoDocumentDB
HomeGitHubDiscordDocsPackagesBlogs
Back to DocumentationMQL Documentation
Commands
Aggregation
Query And Write
Operators
Accumulators
Aggregation
Arithmetic Expression
Array Expression
Array Query
Array Update
Bitwise
Bitwise Query
Bitwise Update
Comparison Query
Conditional Expression
Data Size
Date Expression
Element Query
Evaluation Query
Field Update
Geospatial
Literal Expression
Logical Query
$and
$nor
$not
$or
Miscellaneous
Miscellaneous Query
Object Expression
Projection
Set Expression
Timestamp Expression
Variable Expression
Window Operators
Reference/Operators/Logical Query

MongoDB Query Language (MQL) Logical Query Operators

Logical query operators combine multiple query conditions using logical operations. These operators enable you to construct complex queries by joining conditions with AND, OR, NOT, and NOR operations, allowing for sophisticated document filtering based on multiple criteria.

$and

The $and operator joins multiple query clauses and returns documents that match all specified conditions.

$nor

The $nor operator performs a logical NOR on an array of expressions and retrieves documents that fail all the conditions.

$not

The $not operator performs a logical NOT operation on a specified expression, selecting documents that don't match the expression.

$or

The $or operator joins query clauses with a logical OR and returns documents that match at least one of the specified conditions.

Copyright © DocumentDB a Series of LF Projects, LLC. For web site terms of use, trademark policy and other project policies please see https://lfprojects.org.