Chris
Chris

Reputation: 31206

OrientDB: select edge where out=(select ??) does not work

I have a problem. I think that this is supposed to work, otherwise someone else would have run into this problem.

The following command works perfectly:

// suppose my record id is #10:0

select from MyEdgeType where out=#10:0

This works.

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

The following does not work:

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. 

Nothing works. Nothing. How do I select from edges such that I do not have to know the record id which is incident to the edges I would like to grab ahead of time?

Upvotes: 0

Views: 816

Answers (2)

Chris
Chris

Reputation: 31206

I got this to work.

Since my nodes are unique (this is a constraint), I used the unique property to ID them during the filtration, rather than the record id from a subquery:

 select from MyEdgeType where out.unique_identifier=...

worked.

Upvotes: 0

dgiannotti
dgiannotti

Reputation: 371

You're comparing a single field on a resultset (it's like comparing a string to an array), try something like this:

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

Upvotes: 4

Related Questions