Compare commits
8 commits
main
...
test-memgr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
723a3e7be4 | ||
|
|
50016e45f7 | ||
|
|
58bc710c43 | ||
|
|
2d0f3e7f1f | ||
|
|
5ede210f12 | ||
|
|
ce9173c598 | ||
|
|
879bcc1edf | ||
|
|
7700c2dd0e |
1 changed files with 7 additions and 0 deletions
|
|
@ -376,12 +376,19 @@ class MemgraphAdapter(GraphDBInterface):
|
||||||
|
|
||||||
The result of the edge addition operation, including relationship details.
|
The result of the edge addition operation, including relationship details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
exists = await asyncio.gather(self.has_node(str(from_node)), self.has_node(str(to_node)))
|
||||||
|
|
||||||
|
if not all(exists):
|
||||||
|
return None
|
||||||
|
|
||||||
serialized_properties = self.serialize_properties(edge_properties or {})
|
serialized_properties = self.serialize_properties(edge_properties or {})
|
||||||
|
|
||||||
query = dedent(
|
query = dedent(
|
||||||
f"""\
|
f"""\
|
||||||
MATCH (from_node {{id: $from_node}}),
|
MATCH (from_node {{id: $from_node}}),
|
||||||
(to_node {{id: $to_node}})
|
(to_node {{id: $to_node}})
|
||||||
|
WHERE from_node IS NOT NULL AND to_node IS NOT NULL
|
||||||
MERGE (from_node)-[r:{relationship_name}]->(to_node)
|
MERGE (from_node)-[r:{relationship_name}]->(to_node)
|
||||||
ON CREATE SET r += $properties, r.updated_at = timestamp()
|
ON CREATE SET r += $properties, r.updated_at = timestamp()
|
||||||
ON MATCH SET r += $properties, r.updated_at = timestamp()
|
ON MATCH SET r += $properties, r.updated_at = timestamp()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue