Input

The following table describes the fields on the Input tab of the MapReduce activity.

Input Item Data Type Description
CollectionName String In single or double quotation marks, enter the name for the collection where map-reduce operations are performed.
Note: The value specified in this field overwrites the value specified in the Collection Name field of the General tab.
JavaScriptMapFunction JavaScript In double quotation marks, enter a JavaScript to map an operation in every document in a collection. The operation emits key and value pairs.
Note: The value specified in this field overwrites the value specified in the Map Function field of the General tab.
JavaScriptReduceFunction JavaScript In double quotation marks, enter a JavaScript to reduce all values of a specific key to one element which contains the result.
Note: The value specified in this field overwrites the value specified in the Reduce Function field of the General tab.
JavaScriptFinalizeFunction JavaScript In double quotation marks, enter a JavaScript to modify the output result.
Note: The value specified in this field overwrites the value specified in the Finalize Function field of the General tab.
OutputTarget String In double quotation marks, enter a collection name to store a map-reduce operation result.
Note: If the output type is inline, leave this field blank.
OutputType String Select one output type from the following lists:
  • INLINE

    Returns the result inline.

  • REPLACE

    Replaces the contents of the specified collection, if the specified collection exists .

  • MERGE

    Merges the new result with the existing result if the output collection already exists. If an existing document has the same key as the new result, the new result overwrites that existing document.

  • REDUCE

    Merges the new result with the existing result if the output collection already exists. If an existing document has the same key as the new result, the reduce function is applied to both, the new and the existing documents, and the existing document is overwritten by the result.

QueryDocument String Enter a document name in double quotation marks. This document is used to query documents to be mapped and reduced.
Limit Integer Enter the number to decide how many documents to keep after the query document operation.
SortDocument String Enter a document name in double quotation marks. This document is used to define the display order of documents after the limit operation.