I am trying to create or update a node using below query:
MERGE (u:Book{id:{id1},name:{name1}}) RETURN u
In this, id is unique but name can be changing.
But, this does not work for update.
I get below error:
Node 38 already exists with label Book and property "id"=[1166]
Can't I use MERGE when one of the property has unique constraint?
Note: Version: neo4j-enterprise-2.0.1 schema: Indexes ON :Book(id) ONLINE (for uniqueness constraint)
Constraints ON (book:Book) ASSERT book.guid IS UNIQUE
Use SET
:
MERGE (b:Book {id:{id1}})
SET b.name = {name1}
RETURN b
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With