[英]Include Entry node in AQL Graph traversal
I'm using AQL to traverse through Graphs, right now that's my statement: 我正在使用AQL遍历图,现在这就是我的声明:
FOR v, e, p IN 1..1 ANY 'Bridges/1004'
GRAPH 'S_Graph'
FILTER not (p.vertices[1].IID != 'null' AND p.vertices[1].cls_name == "Bridge")
OR p.vertices[1].cls_name == "Node"
RETURN v
And the result are the Documents my Entry-Document Bridges/1004
, but not the Entry-Document itself. 结果是Documents my Entry-Document
Bridges/1004
,而不是Entry-Document本身。
How is it possible to include the Entry-Document in the Query-Result? 如何将条目文档包含在查询结果中?
Just change the traversal depth from 1..1 to 0..1 and that should include the initial node. 只需将遍历深度从1..1更改为0..1,该深度应包括初始节点。
FOR v, e, p IN 0..1 ANY 'Bridges/1004'
GRAPH 'S_Graph'
FILTER not (p.vertices[1].IID != 'null' AND p.vertices[1].cls_name == "Bridge")
OR p.vertices[1].cls_name == "Node"
RETURN v
Also note that in your original query, if you return the path, it does include all the nodes in the path including the original node 还要注意,在原始查询中,如果返回路径,则它确实包括路径中的所有节点,包括原始节点
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.