Hi all,
I am writing cypher query that inserts values based on JSON values passed with UNWIND. Values are working as expected, but I want to make node name dynamic, based on "class" value on JSON.
Here's working example
UNWIND [{id: "199" , container_id: "203", acl_id: "1047", class: "Usergroup" }] as event
MATCH (u:User {id: event.id}) // I am trying to make User node dynamic in this line
MATCH (ug:Usergroup {id: event.container_id})
OPTIONAL MATCH (u)-[r:CHILD_OF]->(:Usergroup)
DELETE r
SET u.acl_id = event.acl_id ;
CREATE (u)-[rel:CHILD_OF]->(ug);
When I try to change this row
MATCH (u:User {id: event.id})
to
MATCH (u:event.class {id: event.id})
I see this error "Neo.ClientError.Statement.SyntaxError: Invalid input '.': expected ")", "{" or "$" "
What am I doing wrong here?