mapContext.key

Property Description

The key to be processed during the map stage.

  • If the input is an array, the key is the element's index.

  • If the input is an object, the key is the object's key.

  • If the input is a result set, the key is the result's internal ID. If there's no internal ID, the key is the result's index.

Note:

Each key cannot exceed 4000 bytes.

Type

string

Since

2015.2

Syntax

The following code snippet shows the syntax for this member. It's not a functional example. For a complete script example, see SuiteScript 2.x Map/Reduce Script Code Samples.

          // Add additional code 
...
     
    context.write({
        key: context.value[i], 
        value: 1 
    }); 
 ...
// Add additional code 

        

Related Topics

General Notices