For the TPM APIs a new (yay!)
-
value: String,Integer,Float,Array or Object
-
variable: The path of an item on Json,
-
function: A function, can return a
value -
binaryOperator: One of
+ - * / == <= >= > < != -
functionCall:
function(expression*) -
binaryFunction:
expression binaryOperator expressionreturnsboolean -
expression:
[value|variable|function|binaryFunction|functionCall] -
group_ops:
MIN|MAX|AVG|COUNT -
order_expression:
ASC|DESC(fieldname): valid only for strings and numbers
In the select the expression are evaluated in this order
-
WHERE
-
GROUPBY
-
WHAT
-
ORDERBY
-
AND(expression_boolean*)returnsboolean -
OR(expression_boolean*)returnsboolean -
ISNULL(expression)returnsboolean -
ISNOTNULL(expression)returnsboolean -
NOT(expression_booleanreturnsboolean -
TRUEreturnsboolean_trueConstant -
FALSEreturnsboolean_trueConstant -
NULLreturnsnullConstant -
CONTAINS(expression_string,expression_string_to_search_for)returnsboolean -
CONCAT(expression_string*)returnsstring -
FILTER(expression_[object|array],expression_boolean)returnsarray- For arrays the object passed to the second parameter is the item of the array, and it will be named
it - For arrays the object passed to the second parameter is an object with
keyfield with the name of the property andvaluecontaining the value of the property
- For arrays the object passed to the second parameter is the item of the array, and it will be named
-
COUNT(expression_[object|array|string])returnsinteger- For arrays counts the item of the array
- For objects count the properties
- For strings count the length
- If the object is null returns 0
-
SELECT(WHAT(),WHERE(),GROUPBY(),ORDERBY())returns a list, all parameters optional -
WHAT(fieldname|fieldname=expression|group_ops(fieldname)*)select fieldname, or assign to fieldname the value of the expression -
WHERE(boolean_expression)execute a query -
GROUPBY(fieldname*)all fields of select must be in formatvariable=expressionwhereexpressioncan be the variable itself e.g.tags.path=tags.path -
ORDERBY(order_expression*) -
SUBSTR(expression,integer): substring, if done with objects and array, first serializes to json string -
MSTODATE(expression_string): convert to readable date in format YYYY/MM/DD HH:MM:SS.SSSS -
WRAP(expression,integer,string): wrap the string in blocks of integer length using string as separator
Given the object
{"biglist":[ { "name":"TestObject" "list": [ { "id":1, "name":"First", "enabled":true }, { "id":2, "name":"Second" } ], "data": { "description":"Description", "cost":2.22 "enabled":true } }, ... }}
- On the first object directly as input:
- Checking if the object has
data.cost=2.22directly on the first objectdata.cost==2.22COUNT(FILTER(data,AND(key=='cost',value==2.22)))>0
- Checking if the object has
- On the list
- Checking if an object exists with
data.value=2.22directly on the list of objectCOUNT(FILTER(biglist,COUNT(FILTER(it,it.data.value==2.22))>0))>0
- Checking if an object exists with