I am trying to create a batch of nodes from list but I want to make sure those nodes are not already exists in the neo4j db, I manage to do it on a single node but I also want to enable it for batch of nodes I have tried this command:
graphClient.Cypher
.Unwind(NodesList, "singleNode")
.Merge("(node:Node {Id : {innerNode}.Id})")
.OnCreate()
.Set("innerNode= singleNode")
.WithParams("innerNode")
.ExecuteWithoutResults();
and I am getting a error of "Parameter Count Mismatch"
Thanks a lot from advanced.
I'm assuming that NodesList
is a list of the nodes you're wanting to MERGE
- in essence, you need to drop the innerNode
from your query, and use the singleNode
you're passing in from the UNWIND
:
graphClient.Cypher
.Unwind(NodesList, "singleNode")
.Merge("(node:Node {Id : singleNode.Id})")
.OnCreate()
.Set("node = singleNode")
.ExecuteWithoutResults();
This should get you there