一个表达式(Expression)是常量、别名调用、操作符和函数的组合,可以产生一个或多个结果。
目的 |
举例 |
|---|---|
| 使用十进制常量 | -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类型数据的坐标值 | 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) |
| CASE函数运算 | CASE WHEN score >= 80 THEN "pass" ELSE "fail" END |
| Null值判断 | nodes.age IS NULL,edges.time IS NOT NULL |