Mpl supports basic operators,
len. These operartors when applied on types like, number, string, boolean behave like Python. These operator when applied to types unique to Mpl, the behavior not be obvious at first glance. Note that in case of Json type if the Json value is string or number, the same rule applies as their corresponding base type.
Behavior of each operator is as following.
+(add operator): Add operator adds 2 numbers or concatonates 2 strings. It can also be used to add time type with duration to move the. e.g.,
in case of Json:
-(minus operator): Minus operator substracts 2 numbers.
-is not supported on string or boolean type. It can also be used to add or subract a time type with duration. e.g.,
*(multiply operator): Multiply operator multiplies 2 numbers.
*is not supported on string or time type. When duration type is multiplied by a number, the duration gets multiplied by the number.
/(divide operator): Divide operator divides 2 numbers.
/is not supported on string or time type. When duration type is divided by a number, the duration is divided he number.
len(len operator): len operator is applicable to string and JSON type. For string it returns number of characters in a string. In case of Json it returns number of elements in JSON array or number of keys in case of JSON object. If the JSON val is string, it returns string length.