The Index Reduce Function

The Reduce function will group the results from the Maps stage based on the specified field and sum up their values.
The outcome of both the Map and the Reduce functions must have the same structure.

The following Map-Reduce index definition examples index total revenue, per supplier, per category, for products with price per unit > 10 that are not discontinued.

LINQ Map-Reduce Example:

JavaScript Map-Reduce Example: