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
$cmp
$eq
$gt
$gte
$in
$lt
$lte
$ne
$nin
Conditional Expression
Data Size
Date Expression
Element Query
Evaluation Query
Field Update
Geospatial
Literal Expression
Logical Query
Miscellaneous
Miscellaneous Query
Object Expression
Projection
Set Expression
Timestamp Expression
Variable Expression
Window Operators
Reference/Operators/Comparison Query

MongoDB Query Language (MQL) Comparison Query Operators

Comparison query operators compare field values against specified values to filter documents. These operators enable you to perform equality, greater than, less than, and range-based comparisons, forming the foundation of query filtering logic for retrieving documents that meet specific criteria.

$cmp

The $cmp operator compares two values

$eq

The $eq query operator compares the value of a field to a specified value

$gt

The $gt query operator retrieves documents where the value of a field is greater than a specified value

$gte

The $gte operator retrieves documents where the value of a field is greater than or equal to a specified value

$in

The $in operator matches value of a field against an array of specified values

$lt

The $lt operator retrieves documents where the value of field is less than a specified value

$lte

The $lte operator retrieves documents where the value of a field is less than or equal to a specified value

$ne

The $ne operator retrieves documents where the value of a field doesn't equal a specified value

$nin

The $nin operator retrieves documents where the value of a field doesn't match a list of values

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.