code-docs/plugins/operators/mql.md
MongoDB Query Language operators for Lowdefy. Filter and query data using MongoDB-style syntax.
MQL operators let you use MongoDB query syntax to filter arrays and objects in your configuration.
| Operator | Purpose |
|---|---|
_mql_test | Test if object matches query |
_mql_expr | Evaluate aggregation expression |
_mql_aggregate | Run aggregation pipeline on array |
Test if an object matches a query:
isActive:
_mql_test:
on:
_state: user
test:
status: active
age:
$gte: 18
Evaluate aggregation expression:
total:
_mql_expr:
expr:
$multiply:
- $quantity
- $price
on:
_state: item
Run aggregation pipeline:
summary:
_mql_aggregate:
on:
_request: getOrders
pipeline:
- $match:
status: completed
- $group:
_id: $category
total:
$sum: $amount
count:
$sum: 1
Supported query operators:
| Operator | Purpose |
|---|---|
$eq | Equal |
$ne | Not equal |
$gt | Greater than |
$gte | Greater or equal |
$lt | Less than |
$lte | Less or equal |
$in | In array |
$nin | Not in array |
$and | Logical AND |
$or | Logical OR |
$not | Logical NOT |
$regex | Regular expression |
$exists | Field exists |
activeUsers:
_mql_aggregate:
on:
_request: getUsers
pipeline:
- $match:
active: true
role:
$in:
- admin
- editor