解析path获取不到tag信息

版本:2.6.0

            elif i.is_path():
                print(i.as_path().nodes()[0])
                print(i.as_path().nodes()[0]._value)
                print(type(i.as_path().nodes()[0]))
("159.138.142.152" )
Vertex(
    vid=Value(
        sVal=b'159.138.142.152'),
    tags=[])
<class 'nebula2.data.DataObject.Node'>

是什么语句呢


    command = f"GO FROM '{tag}' OVER domain_edge_{tag_name} REVERSELY YIELD DISTINCT id($$) AS url | " \
              f"FIND SHORTEST PATH FROM '{tag}' TO $-.url OVER domain_edge_{tag_name} REVERSELY ;"

find shortest path 只返回 拓扑结构, 如果要带属性,需要 加上 with prop 关键字
参考 FIND PATH - Nebula Graph Database 手册

1 个赞

谢谢,可以了