MongoDB-compatible query language with JSON syntax. Dot notation for nested fields.
| Operator | Description | Example |
|---|---|---|
$eq | Equals | {"age": {"$eq": 30}} or just {"age": 30} |
$ne | Not equal | {"status": {"$ne": "inactive"}} |
$gt | Greater than | {"age": {"$gt": 25}} |
$gte | Greater than or equal | {"age": {"$gte": 25}} |
$lt | Less than | {"salary": {"$lt": 100000}} |
$lte | Less than or equal | {"salary": {"$lte": 100000}} |
$in | Match any in array | {"country": {"$in": ["US", "UK", "JP"]}} |
$exists | Field exists | {"email": {"$exists": true}} |
$regex | Regular expression | {"name": {"$regex": "^A", "$options": "i"}} |
| Operator | Description | Example |
|---|---|---|
$and | All conditions match | {"$and": [{"age": {"$gte": 25}}, {"status": "active"}]} |
$or | Any condition matches | {"$or": [{"city": "Tokyo"}, {"city": "Paris"}]} |
{
"sort": {"age": -1, "name": 1},
"skip": 20,
"limit": 10
}
Sort values: 1 ascending, -1 descending. When an index covers the sort field, sort is O(limit) instead of O(n log n).
// Dot notation for nested access
{"address.city": "Tokyo"}
{"address.zip": {"$regex": "^0"}}
Cross-type comparisons follow a consistent ordering:
Null < Bool < Number < DateTime < String
Date strings (ISO 8601, RFC 3339, YYYY-MM-DD) are auto-detected and stored as epoch milliseconds.