Find repeat customers
A `$match` after `$group` filters summary documents rather than source documents. This lets you ask questions about calculated measures such as order count or total revenue.
For completed orders, find customers with at least two orders. Return `customerId`, `orderCount`, and `revenue`, sorted by revenue descending.
Expected result: Only repeat-customer summaries, with grouping internals removed.
Example pipeline syntax
[
{ $match: { status: "completed" } },
{ $group: { _id: "$customerId", orderCount: { $sum: 1 } } }
]