简体   繁体   English

如何在 ArangoDB 3.2 中查询 OUT 然后 IN 遍历?

[英]How can I query OUT then IN traversal, in ArangoDB 3.2?

I have the following graph structure.我有以下图形结构。 All vertexes are in the same collection, and all edges are in the same collection.所有顶点都在同一个集合中,所有边都在同一个集合中。 From a particular start vertex (F), I want to return all the vertexes that are the result of going outwards once, then inwards once, so that I end up with, in the example, D and E.从特定的起始顶点 (F),我想返回所有顶点,这些顶点是向外一次,然后向内一次的结果,因此在示例中,我最终得到 D 和 E。 在此处输入图片说明

Well after fooling with it for a while, this is what I came up with.好吧,在愚弄了一段时间之后,这就是我想出的。 Seems to work.似乎工作。 Posting this in case someone else searches for a similar question.发布此信息以防其他人搜索类似问题。

 FOR v IN 1..1 OUTBOUND "Vertex/F" edges
  FOR vv IN 1..1 INBOUND v edges 
  FILTER vv._key != "F"
  Collect uniqueKeys = vv._key
  return uniqueKeys

The query take almost a millisecond for a small 8 vertex db, but I don't think I can do better.对于一个小的 8 个顶点数据库,查询需要将近一毫秒,但我认为我不能做得更好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM