Hi,
I want to run a query that adds edges between nodes on some conditions.
The thing is that I only want to make the edge if it’s not existed yet.
for example:
CREATE QUERY create_infected_edge(/* Parameters here /) FOR GRAPH movies SYNTAX V2{
/ Write query logic here */
Result = SELECT a1 from ACTOR:a1-(ANY)-MOVIE:m-(ANY)-ACTOR:a2
WHERE a1 != a2
ACCUM
INSERT INTO infected VALUES (a1, a2, to_datetime(to_string(m.year)+"-01-01"));
PRINT “create_infected_edge works!”;
}
how can I make sure that there is no edge between a1 and a2 and only then add the edge?
Thanks