$count
The `$count` stage returns a count of the number of documents at this stage of the aggregation pipeline. It outputs a document with a single field containing the count.
Syntax
{
$count: <string>
}
Parameters
field
stringrequiredThe name of the output field which contains the count. Must be a non-empty string.
Examples
Sample Data
{
"_id": "0fcc0bf0-ed18-4ab8-b558-9848e18058f4",
"name": "First Up Consultants | Beverage Shop",
"sales": { "totalSales": 75670 }
}