I believe apples is a list of dictionaries. In this case, a more optimized query in simple Cypher will look like this:
UNWIND {apples} AS newApple CREATE (a:Apple) SET a = newApple
I have not used the Neo4jClient.NET lib yet, but something in this direction should work:
graphClient.Cypher .Unwind(apples, "newApple") .Create("(a:Apple)") .Set(...) .ExecuteWithoutResults();
20 kilobyte nodes can work in one transaction, but it is worthwhile to implement some lots and use lots of approx. 10k knots.
Update. Updated implementation as proposed by Chris Scardon.
Note. In a Cypher request, if you are using Neo4j 3.2+, you should switch to a new parameter syntax that uses $param style parameters, so the request is a little easier to read:
UNWIND $apples AS newApple CREATE (a:Apple) SET a = newApple
source share