In OrientDB, the idea Edge works like a connection between vertices with the assistance of certain properties. Edges and vertices are the primary parts of a diagram data set. It applies polymorphism on Edges. The base class for an Edge is E. While executing edges, on the off chance that source or objective vertices are missing or don't exist, at that point the exchange will be rollback.
The accompanying assertion is the essential sentence structure of Create Edge Command.
CREATE EDGE <class> [CLUSTER <cluster>] FROM <rid>|(<query>)|[<rid>]* TO <rid>|(<query>)|[<rid>]*
[SET <field> = <expression>[,]*]|CONTENT {<JSON>}
[RETRY <retry> [WAIT <pauseBetweenRetriesInMs]] [BATCH <batch-size>]
Following are the insights concerning the alternatives in the above sentence structure.
- <class> − Defines the class name for the edge.
- <cluster> − Defines the group where you need to store the edge.
- JSON − Provides JSON substance to establish as the precedent.
- RETRY − Defines the quantity of retries to endeavor in case of contention.
- Stand by − Defines an opportunity to defer between retries in milliseconds.
- Group − Defines whether it separates the order into more modest squares and the size of the bunches.
Example
Execute the accompanying inquiry to make an edge E between two vertices #9:0 and #14:0.
orientdb> CREATE EDGE FROM #11:4 TO #13:2
In the event that the above question is executed effectively, you will get the accompanying yield.
Created edge '[e[#10:0][#9:0->#14:0]]' in 0.012000 sec(s)
Execute the accompanying inquiry to make another edge type and an edge of new kind.
orientdb> CREATE CLASS E1 EXTENDS E
orientdb> CREATE EDGE E1 FROM #10:3 TO #11:4
On the off chance that the above question is executed effectively, you will get the accompanying yield.
Created edge '[e[#10:1][#10:3->#11:4]]' in 0.011000 sec(s)