Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
07-12-2022 05:47 AM
hi
im trying to create node with label words in my database that already exist and wanna add new property(i use constraint method to have unique words name)
my query is :
so i get an error i could fix it with
merge (n:words{name:'‘'})
on match set n.instance = "apostrophe"
with (n) match (a:PartOfSpeech{abbr:'sym'}) merge (n)-[:IS{type:'pos'}]->(a)
but cause im sending query from js i wan to this be automatic is there any way
07-12-2022 06:17 AM
You should probably rethink your model a bit, it might be too generic. You can pull the instance:apostrophe into a node-label, also 'abbr:sym' and type:pos into a relationship-type, instead of using the generic :IS
But yes if you want to update and you don't know if it exists a MERGE with an ON MATCH SET makes sense if you always want to set the instance then you can just use SET
All the sessions of the conference are now available online