Can I find all vertices that have no connected edges in OrientDB?
-
26-10-2019 - |
문제
Is there an easy way to query a cluster for all vertices that have no incoming edges?
해결책
This is more complete because also covers the case the collection exists but it's empty:
select from the_cluster where in().size() = 0
다른 팁
The following SQL seems to work (as edges are stored as fields in
and out
on the vertices):
select from the_cluster where in is null
Should it be this?
select from the_cluster where in_edgename is null
I know it's an old question but figured for anyone else who was wondering the same thing.
You can do something like this: for a vertex of a class say Vtex and the Edge of class say Edg
select from Vtex where in('Edg').size() =0
This will return all the vertices of Vtex class which have no incoming edge of type Edg.
제휴하지 않습니다 StackOverflow