Hosted extractor mapping language
The hosted extractor mapping language translates JSON structures to other JSON structures. The language is similar to JavaScript and is purely functional. A mapping is a single expression that describes how to build one JSON structure from another.
Variables
Use these input objects to define a mapping:
-
input- This is the content of the received message, parsed into an object. -
context- This contains information about the message. The content of this object varies between the different hosted extractors.For MQTT, the
contextobject containstopic: which topic the message arrived at
For examples of using these variables, see Handling more data in a single message.
When variables are objects or arrays they can be selected from. For example, given the object
{
"someField": 123,
"someArray": [1, 2, 3, { "nested": [1, 2, 3] }]
}
you can select from an object with
input.someField -> 123