MongoDB query compiled from plain English against the saasUsers sample schema, then verified by running it.
{
"type": "aggregation",
"collection": "users",
"pipeline": [
{},
{},
{},
{},
{}
]
}
$group — groups by "$teamId" and aggregates count.$match — filters on count.$lookup — joins the teams collection on _id → _id.$unwind — flattens $team into one document per element.$project — returns only _id, name, plan, userCount.$group, count counts documents in each group — one output document per distinct "$teamId".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.