6

使用 OrientDB 的查询语言,如何找到集群a中没有以类顶点结尾的出边的所有顶点b(即没有类的直接邻居顶点b)?他们是否有其他传出边缘并不重要。

4

1 回答 1

3

如果您将 A 类映射到集群 a,您可以执行以下操作:

select from A where not( out.in.@class in ['b'] )

这意味着交叉 A 记录的“out”属性(作为边),然后是“in”属性(顶点),然后得到类名(@class)。我使用了 IN 运算符而不是 = (equals),因为“out.in.@class”返回一个类名的集合。

如果你不想有 A 类并且你必须通过集群 A 使用 cluster: 语法:

 select from cluster:A where not( out.in.@class in ['b'] )

我已经针对最新的 1.0rc8-SNAPSHOT 进行了测试并且可以正常工作。

于 2012-01-14T19:04:36.980 回答