This command deletes one or more edges from the database. Use this command if you work against graphs. The "Delete edge" command takes care to remove all the cross references to the edge in both "in" and "out" vertices.
DELETE EDGE <rid>|[<rid> (, <rid>)*]|FROM <rid>|TO <rid>|[<class>] [WHERE <conditions>]> [LIMIT <MaxRecords>]
The WHERE clause is common to the other SQL commands.
DELETE EDGE [<rid> (, <rid>)*]
Delete edges where date is a property which might exist in one of more edges between the two vertices:
DELETE EDGE from #11:101 TO #11:117 Where date >= "2012-01-15"
Deletes edges filtering also by Edge's class:
DELETE EDGE FROM #11:101 TO #11:117 WHERE @class = 'owns' and comment like "regex of forbidden words"
This is the faster alternative to DELETE EDGE WHERE @class = 'owns' and date < "2011-11"
:
DELETE EDGE Owns WHERE date < "2011-11"
Deletes edges where in.price shows the condition on 'to vertex' for the edge
DELETE EDGE Owns WHERE date < "2011-11" and in.price >= 202.43
When User follow a company We create edge between User and company of type followCompany and CompanyFollowedBy class
node1 is User node,
node2 is company node
OGraphDatabase rawGraph = orientGraph.getRawGraph();
String[] arg={"followCompany,"CompanyFollowedBy"};
Set<OIdentifiable> edges=rawGraph.getEdgesBetweenVertexes(node1, node2,null,arg);
for (OIdentifiable oIdentifiable : edges) {
**rawGraph.removeEdge(oIdentifiable);
}