简体   繁体   English

ArangoDB Join Edge 集合

[英]ArangoDB Join Edge collections

I have 1 node and two edge collections.我有 1 个节点和两个边缘集合。 I want to write an AQL query to find the common nodes between the two edge collections.我想编写一个 AQL 查询来查找两个边集合之间的公共节点。 How can I join two edge collections as there is not common field in the 2 edge collections to query.我如何加入两个边缘集合,因为 2 个边缘集合中没有要查询的公共字段。 As I am trying to find nodes the common node ids can exist either is _from or _to fields当我试图找到节点时,常见的节点 ID 可以是_from_to字段

Let's say I have 2 edges in 2 different edges collections as the following : Edge-1 : _from: A1 _to: B1 Edge-2 : _from: B1 _to: C2假设我在 2 个不同的边集合中有 2 个边,如下所示: Edge-1 : _from: A1 _to: B1 Edge-2 : _from: B1 _to: C2

The output would be B1 because it is common among the two edge collections输出将是B1因为它在两个边集合中很常见

following query would return B1 :以下查询将返回B1

FOR e1 IN edge_1
FOR e2 IN edge_2
FILTER e1._to == e2._from
FOR n IN nodes
FILTER n._id == e1._to
RETURN DISTINCT n

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

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