0

I have written this function to insert data as batch but while adding labels I am getting BindError: Local entity is not bound to a remote entity.

def bulkInsertNodes(n=1000):
    graph = Graph()
    btch = WriteBatch(graph)
    nodesList = []
    for i in range(1,n+1):
        temp = Node(id = str(i))
        nodesList.append(temp)
        btch.create(temp)
    btch.run()

    btch = WriteBatch(graph)
    for n in nodesList:
        btch.add_labels(n,"Person")
    btch.run()
Aacini
  • 65,180
  • 12
  • 72
  • 108
user3382968
  • 378
  • 4
  • 16
  • Please include the entire exception stack. – FrobberOfBits Mar 25 '15 at 20:31
  • the problem is that im using the nodes in nodesList that are not binded to the remote data. So I have to do that. I have solved it. Thnk you for responding. def bulkInsertNodes(n=1000): graph = Graph() btch = WriteBatch(graph) for i in range(1,n+1): btch.create(Node(id = str(i))) nodesList = btch.submit() btch = WriteBatch(graph) for n in nodesList: btch.add_labels(n,"Person") nodesList = btch.submit() – user3382968 Mar 26 '15 at 20:14

0 Answers0