MongoDB query compiled from plain English against the ecommerce sample schema, then verified by running it.
{
"type": "aggregation",
"collection": "orders",
"pipeline": [
{},
{},
{},
{}
]
}
$match — filters on status.$group — groups by "$status" and aggregates count.$group — groups by null and aggregates total, statuses.$project — returns only _id, cancelledPercent, completedPercent._id: null groups the entire collection into a single result rather than grouping by a field.$group, count counts documents in each group — one output document per distinct "$status".Live output from running this query against the sample dataset.
| cancelledPercent | completedPercent |
|---|---|
| 100 | 0 |
Write this in plain English instead. Mask Databases compiles the sentence above into exactly this query at build time — no AI at runtime, and you can read the output in a diff.
Try it in the playground → No signup, runs in your browser.