MongoDB query compiled from plain English against the blog sample schema, then verified by running it.
{
"type": "aggregation",
"collection": "authors",
"pipeline": [
{},
{},
{},
{}
]
}
$lookup — joins the posts collection on _id → authorId.$unwind — flattens $posts into one document per element.$group — groups by "$_id" and aggregates author, averageViews.$project — returns only author, averageViews.$group, author takes the first value in the group, averageViews averages $posts.views — one output document per distinct "$_id".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.