表达式是基于常量、别名进行的调用、操作符运算、函数运算,以及各种组合。
目的 |
举例 |
---|---|
十进制常量 | -10.25,1,1691636269 |
文本常量 | "graph",'uql',' both ' and " ',"2020-01-01 0:0:0" |
由常量构造的列表 | [1, 2, 3],["graph", "database"],[ ] |
别名 | nodes ,edges ,paths ,mylist ,groupName ,count ,`ABC-123` |
调用的属性 | nodes.age ,edges.`version-old` ,this.age ,age |
调用的 point 类型的 x、y | location.x ,location.y |
调用的 schema | edges.@ ,this.@ |
调用的列表元素 | mylist[5] ,mylist[3:6] ,mylist[2:] ,mylist[:4] |
由别名构造的列表 | [nodes.level , -1, "NaN"],[groupName , count ] |
去重运算 | DISTINCT nodes.name ,DISTINCT nodes.name, nodes.age |
数值运算 | 1 + 3 * 2 ,year("2022-04-12") % 4 |
条件判断 | 3 > 1 ,nodes.age == 20 ,@default ,groupName IN ["graph", "database"] |
逻辑运算 | @student && age > 10 |
一般函数运算 | now() ,toString(nodes.age) ,length(paths) |
聚合函数运算 | count(nodes) ,collect(nodes.age) |
null 值判断 | nodes.age IS NULL ,edges.time IS NOT NULL |
CASE 函数运算 | CASE WHEN score >= 80 THEN "pass" ELSE "fail" END |
更多别名调用格式请阅读别名系统。
更多函数请阅读函数。