引用符
nGQL提供引用符来表示WHERE
和YIELD
子句中的属性,或者复合查询中管道符之前的语句输出结果。
openCypher兼容性
引用符仅适用于nGQL扩展。
引用符列表
引用符 | 说明 |
---|---|
$^ | 引用起始点。更多信息请参见引用属性。 |
$$ | 引用目的点。更多信息请参见引用属性。 |
$- | 引用复合查询中管道符之前的语句输出结果。更多信息请参见管道符。 |
示例
# 返回起始点和目的点的年龄。
nebula> GO FROM "player100" OVER follow YIELD $^.player.age AS SrcAge, $$.player.age AS DestAge;
+--------+---------+
| SrcAge | DestAge |
+--------+---------+
| 42 | 36 |
+--------+---------+
| 42 | 41 |
+--------+---------+
# 返回player100追随的player的名称和团队。
nebula> GO FROM "player100" OVER follow \
YIELD follow._dst AS id | \
GO FROM $-.id OVER serve \
YIELD $^.player.name AS Player, $$.team.name AS Team;
+-----------------+-----------+
| Player | Team |
+-----------------+-----------+
| "Tony Parker" | "Spurs" |
+-----------------+-----------+
| "Tony Parker" | "Hornets" |
+-----------------+-----------+
| "Manu Ginobili" | "Spurs" |
+-----------------+-----------+