引用符

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

openCypher兼容性

引用符仅适用于原生nGQL。

引用符列表

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

示例

  1. # 返回起始点和目的点的年龄。
  2. nebula> GO FROM "player100" OVER follow YIELD properties($^).age AS SrcAge, properties($$).age AS DestAge;
  3. +--------+---------+
  4. | SrcAge | DestAge |
  5. +--------+---------+
  6. | 42 | 36 |
  7. | 42 | 41 |
  8. +--------+---------+
  9. # 返回player100追随的player的名称和团队。
  10. nebula> GO FROM "player100" OVER follow \
  11. YIELD dst(edge) AS id | \
  12. GO FROM $-.id OVER serve \
  13. YIELD properties($^).name AS Player, properties($$).name AS Team;
  14. +-----------------+-----------+
  15. | Player | Team |
  16. +-----------------+-----------+
  17. | "Tony Parker" | "Spurs" |
  18. | "Tony Parker" | "Hornets" |
  19. | "Manu Ginobili" | "Spurs" |
  20. +-----------------+-----------+

最后更新: October 27, 2021