Reputation: 29
Need some help insert or update using cypher.
I have the following cypher query:
cypher = 'MERGE (user:Person:User {email: {email}}) ON CREATE user = {props} SET user.created = timestamp() ON MATCH SET user.lastSeen = timestamp() RETURN user';
This seem to throw a error:
errorError: Invalid input 'u': expected whitespace, comment or SET (line > 1, column 53) "MERGE (user:Person:User {email: {email}}) ON CREATE user = {props} SET > user.created = timestamp() ON MATCH SET user.lastSeen = timestamp() RETURN > user"
Upvotes: 0
Views: 146
Reputation: 41676
you forgot the first SET
cypher = '
MERGE (user:Person:User {email: {email}})
ON CREATE SET user = {props}, user.created = timestamp()
ON MATCH SET user.lastSeen = timestamp()
RETURN user';
Upvotes: 1