0
votes

Need some help insert or update using cypher..

I have a 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"

Appreciate if someone could point out what I maybe doing wrong.

  • Shekar
1

1 Answers

1
votes

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';