MongoDB query compiled from plain English against the ecommerce sample schema, then verified by running it.
{
"type": "aggregation",
"collection": "orders",
"pipeline": [
{},
{},
{},
{},
{},
{}
]
}
$unwind — flattens $productIds into one document per element.$group — groups by "$productIds" and aggregates orderCount.$match — filters on orderCount.$lookup — joins the products collection on _id → _id.$unwind — flattens $productInfo into one document per element.$project — returns only _id, productId, name, priceCents, category, inStock, orderCount.priceCents stores money as an integer number of cents — divide by 100 before displaying it.$group, orderCount counts documents in each group — one output document per distinct "$productIds".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.