2

My understanding of neo4j is that we can use Merge to add a node in such a way that we won't get duplicates. The py2neo v4 documentation says that

For a GraphObject, create and merge are an identical operation

Yet when I execute the following code, I get 3 nodes in my graph:

graph.create(Node("Person", id="Bob"))
graph.create(Node("Person", id="Bob"))
graph.create(Node("Person", id="Bob"))

How can I add a node while also checking that the node doesn't already exists?

theQman
  • 1,690
  • 6
  • 29
  • 52

0 Answers0