Can I find all vertices that have no connected edges in OrientDB?
-
15-04-2021 - |
Frage
Is there an easy way to query a cluster for all vertices that have no incoming edges?
Lösung
This is more complete because also covers the case the collection exists but it's empty:
select from the_cluster where in().size() = 0
Andere Tipps
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.
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow