mapContext.value

Property Description

The value to be processed during the map stage.

  • If the input type is an array, the mapContext.value is the value in the element.

  • If the input type is an object, the mapContext.value is the value in the object.

  • If the input type is a result set, the mapContext.value is a search.Result object converted to a JSON string by using JSON.stringify().

Note:

Each value cannot exceed 1 megabyte.

Type

string

Since

2015.2

Syntax

The following code snippet shows the syntax for this member. It is not a functional example. For a complete script example, see Map/Reduce Script Samples.

            // Add additional code.
...

// Assume that the search result is a list of phone call records. This snippet parses the results
// and uses the values of the title and the message fields from each record.

var searchResult = JSON.parse(context.value);
          
var title = searchResult.values.title;
var message = searchResult.values.message;

...
// Add additional code. 

          

Related Topics

mapContext
mapContext.isRestarted
mapContext.executionNo
mapContext.errors
mapContext.key
mapContext.write(options)

General Notices