Search code examples
orientdb

select only vertex from TRAVERSE outE(), inV() FROM ... command


I have a SQL Command that currently works just fine as below

select from (traverse outE(), inV() from (select from Foo where name='root') while active=true) where @class='Foo'

However I think it will not work for the case I have many different types of vertex connected together. Therefore I need to replace the where condition with something like

select from (traverse outE(), inV() from (select from Foo where name='root') while active=true) where @elementType='Vertex'

Is there special function to determine element type which is available in Java API (OrientElement.getElementType())?


Solution

  • use this as where condition:

    where @this instanceof 'V'