OrientDB:选择边缘,其中out =(select ??)不起作用

时间:2018-04-09 22:24:51

标签: orientdb orientdb2.2

我有问题。我认为这应该有效,否则其他人会遇到这个问题。

以下命令完美运行:

// suppose my record id is #10:0

select from MyEdgeType where out=#10:0

这很有效。

select from MyNodeType where name="this"
> returns obj with @rid = #10:0

以下不起作用:

select from MyEdgeType where out=(select from MyNodeType where name="this")
select from MyEdgeType where out=(select @rid from (select from MyNodeType where name="this")
select from MyEdgeType let $rec = (select fcom MyNodeType...) where out=$rec.rid


... etc. 

没有任何作用。没有。如何从边缘中进行选择,以便我不必知道我想提前抓取的边缘出现的记录ID?

2 个答案:

答案 0 :(得分:4)

您正在比较结果集上的单个字段(比如将字符串与数组进行比较),请尝试以下操作:

select from MyEdgeType where out IN (select from MyNodeType where name="this")

答案 1 :(得分:0)

我让这个工作。

由于我的节点是唯一的(这是一个约束),我在过滤期间使用唯一属性来识别它们,而不是来自子查询的记录ID:

 select from MyEdgeType where out.unique_identifier=...

的工作。

相关问题