select all vertices with no incoming edges

149 views
Skip to first unread message

David de Sousa Seixas

unread,
Jun 3, 2015, 7:51:03 AM6/3/15
to orient-...@googlegroups.com
hi

  I'm trying to get all vertices that have no incoming edges. How do I do that?

thanks

Giulia Brignoli

unread,
Jun 3, 2015, 8:20:15 AM6/3/15
to orient-...@googlegroups.com
Hi David,

try this query:

 select from V where @rid not in (select expand(out()) from V)

in this way you should find all the vertices that have no incoming edges.

Bye, Giulia

Luigi Dell'Aquila

unread,
Jun 4, 2015, 6:19:55 AM6/4/15
to orient-...@googlegroups.com
Hi David,

you can also do this:

select from V were in().size() = 0

--

---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Luigi Dell'Aquila

unread,
Jun 4, 2015, 6:20:13 AM6/4/15
to orient-...@googlegroups.com
sorry, typo there ;-)

select from V WHERE in().size() = 0

David de Sousa Seixas

unread,
Jun 11, 2015, 12:45:25 PM6/11/15
to orient-...@googlegroups.com
Thanks!
Reply all
Reply to author
Forward
0 new messages