Re: Not all nodes are created

3 views
Skip to first unread message

Sankrant Chaubey

unread,
Jun 13, 2018, 7:39:01 AM6/13/18
to ne...@googlegroups.com
I am sorry for the last message, my hand slipped.

I was trying to create n number of nodes with a python loop

for i in range(100):
z = "CREATE (:percent { percent: " + str(i) + "})"
session.run(z)
but only 64 nodes were created. I figured that it might be due to python loop sending info faster than neo4j can process, so I added a time.sleep(0.1); I got all the nodes after that but it is causing a lot of extra latency in data upload we do not want. What is the optimal way to create a lot of nodes.

Sorry for the broken english and bad first post, its the first time I was posting
Thanks,
Sankrant 

On Wed, Jun 13, 2018 at 11:06 AM, Sankrant Chaubey <sankrant...@gmail.com> wrote:
Hi,

I am trying to create say 100 nodes with a python loop like this:
for i in range(100):
z = "CREATE (:percent { percent: " + str(i) + "})"
print z
session.run(z)


Michael Hunger

unread,
Jun 13, 2018, 7:47:40 AM6/13/18
to ne...@googlegroups.com
1. you need also consume the session.run() results
2. use parameters, not string concatenation

--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sankrant Chaubey

unread,
Jun 13, 2018, 7:52:07 AM6/13/18
to ne...@googlegroups.com
Thank you very much!
Reply all
Reply to author
Forward
0 new messages