As it says in the docs, the add_to_index
method takes one key and one value as input. So I think you have to add the node to the index twice if you want to index two names
.
# add_to_index(cls, index, key, value, entity)
names = ["Hello", "Bye"]
for n in names:
batch.add_to_index(neo4j.Node, "NAME", "name", n, mynode)
batch.submit()