neo4j-contrib / py2neo

EOL! Py2neo is a comprehensive Neo4j driver library and toolkit for Python.
https://py2neo.org
Apache License 2.0
20 stars 8 forks source link

bulk create_relationships not working #913

Closed ssfd7 closed 3 years ago

ssfd7 commented 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

ssfd7 commented 3 years ago

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.