Closed ssfd7 closed 3 years ago
Trying to execute this sample code - copy and paste from https://py2neo.org/2021.0/bulk/index.html: from py2neo import Graph from py2neo.bulk import create_relationships g = Graph() data = [ (("Alice", "Smith"), {"since": 1999}, "ACME"), (("Bob", "Jones"), {"since": 2002}, "Bob Corp"), (("Carol", "Singer"), {"since": 1981}, "The Daily Planet"), ] create_relationships(g.auto(), data, "WORKS_FOR", \ start_node_key=("Person", "name", "family name"), end_node_key=("Company", "name"))
However no changes to the database. And yes I have changed this line with real bolt connection: g = Graph()
Thank you
Never mind - figured out - both source and target nodes have to exist before creating relationships - which makes sense.
The documentation needs to be updated though - to make that clear.
Trying to execute this sample code - copy and paste from https://py2neo.org/2021.0/bulk/index.html: from py2neo import Graph from py2neo.bulk import create_relationships g = Graph() data = [ (("Alice", "Smith"), {"since": 1999}, "ACME"), (("Bob", "Jones"), {"since": 2002}, "Bob Corp"), (("Carol", "Singer"), {"since": 1981}, "The Daily Planet"), ] create_relationships(g.auto(), data, "WORKS_FOR", \ start_node_key=("Person", "name", "family name"), end_node_key=("Company", "name"))
However no changes to the database. And yes I have changed this line with real bolt connection: g = Graph()
Thank you