简体   繁体   中英

Orientdb query for getting all vertices connected by edge of specyfic type

I'm looking for query that will return vertices that are connected to specific vertex (with known rid) by specific edge class, problem is that the connected vertices can have different classes

我的图

in this example i need query that will give me #68:0, #72:5. What I need exactly, is the properties data for them and in orient studio browse mode it returns only links to them result

Given a specific vertex rid and edge class you can use the out() function to get adjacent outgoing vertices and the expand() function to include all fields:

SELECT expand(out("has_conditionsElement")) FROM #44:62

You can also use in() for incoming vertices:

SELECT expand(in("has_conditionsElement")) FROM #44:62

Or both() for all directions:

SELECT expand(both("has_conditionsElement")) FROM #44:62

Source:

SQL-Functions > out()

SQL-Functions > in()

SQL-Functions > both()

SQL-Functions > expand()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM