MongoDB query compiled from plain English against the ecommerce sample schema, then verified by running it.
{
"type": "aggregation",
"collection": "orders",
"pipeline": [
{},
{},
{}
]
}
$lookup — joins the customers collection on customerId → _id.$unwind — flattens $customer into one document per element.$project — returns only _id, customerId, productIds, totalCents, status, placedAt, customerName.totalCents stores money as an integer number of cents — divide by 100 before displaying it.Live output from running this query against the sample dataset.
| totalCents | status | placedAt | customerId | productIds | customerName |
|---|---|---|---|---|---|
| 8900 | delivered | 2026-08-01T20:08:22.972Z | 6a710150fb3d9d8ba951f41c | ["6a710150fb3d9d8ba951f420"] | Ava Chen |
| 10300 | shipped | 2026-07-30T20:08:22.972Z | 6a710150fb3d9d8ba951f41d | ["6a710150fb3d9d8ba951f420","6a710150fb3d9d8ba951f422"] | Marcus Reid |
| 1400 | pending | 2026-08-02T20:08:22.972Z | 6a710150fb3d9d8ba951f41f | ["6a710150fb3d9d8ba951f422"] | Sam Okafor |
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.