Search code examples
databaseorientdbgraph-databases

orientdb - How to filter child vertexes without traverse


I haму class State extended from V, Records of State connected into graph with E. Also i have variable with rid: $current. How to select other outgoing State from $current and filter them with WHERE?

I know how to implement if with TRAVERSE, but is it possible to do it without it?

SELECT EXPAND(out()) FROM (TRAVERSE out() FROM $current MAXDEPTH 1) WHERE out().keys IN ['a', 'b', 'c']

Solution

  • what about this?

    select expand(out()) from $current where out().keys IN ['a', 'b', 'c']
    

    EDIT

    here is my sample data data

    with the previous query I obtain these results that sounds a bit incorrect to me query1


    instead of that I wrote this that looks more correct:

    select from (select expand(out()) from $current) where keys IN ['a', 'b', 'c']
    

    resulting in: query2


    Let me know if this helps you. Ivan