我正在尝试使用 Neo4j Go 驱动程序。
我已经编写了这个代码片段来获取从节点 1 到节点 5 的路径,但是无法正确获取 api 中提到的结果。
result, err = session.Run("match (n:Xyz{title:1}),(m:Xyz{title:5}),p=allShortestPaths((n)-[*]->(m)) return p",nil)
if err != nil {
return "",err
}
for result.Next() {
keys := result.Record().Keys()
fmt.Println(keys)
values_NEO := result.Record().Values()
nodes := values_NEO[0].Nodes()
labels := nodes.Labels()
fmt.Println(labels)
}
我收到以下错误:
values_NEO[0].Nodes undefined (type interface {} is interface with no methods)
我的图表是这样的:
隔江千里
相关分类