跳转至

引用符Graph

nGQL 提供引用符来表示WHEREYIELD子句中的属性,或者复合查询中管道符之前的语句输出结果。

openCypher 兼容性Graph

引用符仅适用于原生 nGQL。

引用符列表Graph

引用符 说明
$^ 引用起始点。更多信息请参见Graph。
$$ 引用目的点。更多信息请参见Graph。
$- 引用复合查询中管道符之前的语句输出结果。更多信息请参见Graph。

示例Graph

# 返回起始点和目的点的年龄。
nebula> GO FROM "player100" OVER follow YIELD properties($^).age AS SrcAge, properties($$).age AS DestAge;
+--------+---------+
| SrcAge | DestAge |
+--------+---------+
| 42     | 36      |
| 42     | 41      |
+--------+---------+

# 返回 player100 追随的 player 的名称和团队。
nebula> GO FROM "player100" OVER follow \
        YIELD dst(edge) AS id | \
        GO FROM $-.id OVER serve \
        YIELD properties($^).name AS Player, properties($$).name AS Team;
+-----------------+-----------+
| Player          | Team      |
+-----------------+-----------+
| "Tony Parker"   | "Spurs"   |
| "Tony Parker"   | "Hornets" |
| "Manu Ginobili" | "Spurs"   |
+-----------------+-----------+

最后更新: November 24, 2021
Back to top