gaurav.singharoy
gaurav.singharoy

Reputation: 3921

How should I add labels in batches using py2neo

I am creating a lot of nodes in neo4j using python's py2neo. I am using neo4j version 2 which has support for labels. I would like to add a label to the node I have created in batches. Is there a way to do that ?

a = batch.create(node(name='Alice'))

Now I would like to add the labels "Female", and "Human" to a.

Upvotes: 2

Views: 1060

Answers (1)

Nigel Small
Nigel Small

Reputation: 4495

It's already possible to add labels within batches. Have a look in the docs here:

http://book.py2neo.org/en/latest/batches/#py2neo.neo4j.WriteBatch.add_labels

Upvotes: 3

Related Questions