MongoDB query compiled from plain English against the ecommerce sample schema, then verified by running it.
{
"type": "aggregation",
"collection": "orders",
"pipeline": [
{},
{},
{}
]
}
$lookup — joins the products collection on productIds → _id.$unwind — flattens $products into one document per element.$project — returns only _id, customerId, totalCents, status, placedAt, productName.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 | productName |
|---|---|---|---|---|
| 8900 | delivered | 2026-08-01T20:08:22.972Z | 6a710150fb3d9d8ba951f41c | Mechanical Keyboard |
| 10300 | shipped | 2026-07-30T20:08:22.972Z | 6a710150fb3d9d8ba951f41d | Mechanical Keyboard |
| 10300 | shipped | 2026-07-30T20:08:22.972Z | 6a710150fb3d9d8ba951f41d | Ceramic Mug |
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.