A JavaScript function that "reduces" to a single object all the values associated with a particular key.

The reduce function exhibits the following behaviors:

 * The reduce function should not access the database, even to perform read operations.

 * The reduce function should not affect the outside system.

 * MongoDB will not call the reduce function for a key that has only a single value. The values argument is an array whose elements are the value objects that are "mapped" to the key.

 * MongoDB can invoke the reduce function more than once for the same key. In this case, the previous output from the reduce function for that key will become one of the input values to the next reduce function invocation for that key.

 * The reduce function can access the variables defined in the scope parameter.

 * The inputs to reduce must not be larger than half of MongoDB's maximum BSON document size. This requirement may be violated when large documents are returned and then joined together in subsequent reduce steps.
