Map¶
The Map function takes key:value
pairs as input and transforms them into
different key:value
pairs when they meet defined criteria.
The output of the Map function is the new set of key:value
pairs.
This mapping forwards the same key:value
if the key meets the defined pattern
and if the value is a string in the list.
{
"id": "playersLike",
"source": "userinput",
"where": {
"key": ["players", "<playerId>", "reaction"],
"type": "string",
"name": "<reaction>"
"$in": ["like", "love", "laugh", "surprised", "sad", "mad"]
},
"key": ["players", "<playerId>", "reaction"],
"value": "<reaction>"
}
Map schema¶
id
A unique string that refers to the map. Used for modifying the map after its creation.
source
A string that indicates where the event originated. (Only “userinput” is currently supported.)
where
A schema defining the conditions that trigger producing a newkey:value
pair. See Where schema for more information.
key
An array of strings representing the new key. Each string can be:
- Alphanumeric string: A plain literal value.
<anyText>
: A named value taken from the input key.
value
Specifies what value to assign the key to. Values produced by the map can be:
<anyText>
: A named value taken from the input key.
- String: A plain literal string value.
- Number: Any numeric value.
- Boolean: A boolean value (
true
orfalse
).