Reputation: 7719
For instance, if i have the following JSON
{people:[{name:'peter'},{name:'paul'}]}
what is the cypher syntax to create unique nodes based on 'name' with a label of 'people'?
Upvotes: 0
Views: 64
Reputation: 1108
I suspect you will have to parse the string in to cypher. There is no DSL for cypher that will support your usecase that I'm aware of. Maybe you could regex the syntax based on the comma delimiter?
merge (person:People {name:{name}})
is the basic syntax. You will also want to have a constraint on that Label to enforce uniqueness.
create constraint on (person:People) assert person.name is unique
Upvotes: 1