1.10 - 5 2.(100 - 20) * 8 3.'Altogic' + '-' + 'Backend as a service platform' 4.(shoppingCart.totalPrice / SIZE(shoppingCart.items)) > 25
SIZE
function. This last expression checks whether the average price of an item in an imaginary shopping cart object is greater than 25 or not. As seen from the above examples, the expression types and combinations may differ from one expression to another. However, the main rule is to keep combinations and types similar to each other. The results of the expression operands evaluation, namely the values, must be of the same type to have a proper operator implementation.true
false
134
56.98
'Hello world!'
'2020-04-01T06:40:12.941+00:00'
['pop', '90s', 'urban', 'dance']
[29.032589793205258, 41.2200826257151]
profile.email
address.city
Example:-(10 + ((10 * 5 - 4) / 100 - 20))
Example:(profile.firstName && profile.lastName) || profile.fullName
&&
, OR function for ||
and NOT function for !
operator. Using the functions instead of operators, the above example can be written as:OR(AND(profile.firstName, profile.lastName), profile.fullName)
Example:task.completionDate > task.dueDate
Examples:
1.'10' + '20' + '30' 2.'Result : ' + (10 * 5 + 100) 3.SIZE([45,26,94,73]) == 4
102030
. The second expression is a special one, and evaluation result of this expression is Result : 150
. This is again a string concatenation operation, but the second expression is evaluated as a mathematical one, and the result is converted to a string value. The last expression is a relational equality check whether the left operand value equals the right operand value. size
is a built-in function that returns the length (count of items) of an array. In this case, the array length is 4, and this overall expression evaluates to true (1).Examples:
1.STARTSWITH(main_text, search_text)â€‹STARTSWITH("Jonh Adams", "Jon")â€‹ 2.PRODUCT(number1, number2, ...)â€‹PRODUCT(10, 23, 5, -75)â€‹
Examples:
1.quantity > 100 && quantity < 200 && type == "plastic" 2.(weight / volume > 2 && type == 'metal') || (weight / volume <= 2 && type == 'plastic')