go语句限制目标节点范围,条件为上一步返回的dst,如何写语句

  • nebula 版本:3.6
  • 部署方式:单机
  • 安装方式: RPM
  • 是否上生产环境:N
  • 问题的具体描述:
    tag和边的关系如下:
    team–[hasplayer]–>player
    player–[hasfriend]–>player
    查找同一个team下是朋友关系的球员之间的关系。

go 1 step from “team1” over hasplayer yield dst(edge) AS dst |
GO 1 STEPS FROM $-.dst over hasfriend where dst(edge) in (上一步返回的dst) YIELD edge as e

这个sql现在支持吗?该怎么写?

可以试试

match (v:team)-[:hasplayer]->(p1:player)-[e: hasfriend]->(p2:player)<-[:hasplayer]-(v:team) where id(v) == “team1” return e

match可以这么写,但考虑性能,我希望是用go语句,不知道能不能写出来

GO FROM 'team1' OVER hasplayer YIELD src(edge) as team, edge(edge) as p1 |
GO FROM $-.p1 OVER hasfriend YIELD $-.team as team, src(edge) as p1, dst(edge) as p2 |
GO FROM $-.p2 OVER hasplayer REVERSELY WHERE src(edge) == $-.team YIELD $-.p1 as p1, $-.p2 as p2
1 个赞

此话题已在最后回复的 30 天后被自动关闭。不再允许新回复。