Map/Reduce is a programming model and an associated implementation for processing and generating large datasets. RavenDB indexes are Map/Reduce implementations and allow you to perform aggregations over multiple documents. Indexes use a Map
function to specify what to retrieve from the server and optionally use Reduce
and Transform
functions to specify which results will be returned to the client.
Developer specifies one or more Map
function(s) that processes a documents collection to generate a set of intermediate key-value pairs. The intermediate key-value pairs produced by the Map
function are buffered in memory.
The Reduce
function is not compulsory. An index may have zero or only one Reduce
function. The Reduce
function reads all intermediate key-value pairs generated by the Map
(s) function(s) and aggregates associated values with the same intermediate key. After successful completion, the output of the Reduce
function execution is available to the caller...