Reputation: 85
I have graph in Neo4j, and I want to set the relationship between 2 nodes.
For two nodes, 2 arrows are created in different directions, can I somehow replace it with one bidirectional one?
for node in nodes_of_mobile:
if nodes_mobile[node]['social_contact'] != 0:
for neighbor in nodes_mobile[node]["social_contact"]:
command = "MATCH (a:Person),(b:Person) WHERE " \
f"a.id='{node}' AND " \
f"b.id='{neighbor}' " \
"CREATE (a)-[r:Network]->(b)"
graph_Neo4j.run(command)
I use python to fill in the links. If you can't create bidirectional relationships, can you determine if there is a specific type of connection between nodes and not repeat them again?
Upvotes: 0
Views: 194