我想使用 SET 子句向节点添加一个新属性。但是发生了错误并且没有执行查询。
1)第一个命令和错误消息:
MATCH (j {name:'Jack'}) SET j.hobby = 'Playing the guitar';
ERROR: invalid input syntax for type json
LINE 1: match (j {name:'Jack'}) SET j.hobby = 'Playing the guitar';
^
DETAIL: Token "Playing" is invalid.
CONTEXT: JSON data, line 1: Playing...
2)第二个命令和错误消息:
MATCH (j {name:'Jack'}) SET j.hobby = "Playing the guitar";
ERROR: column "Playing the guitar" does not exist
LINE 1: match (j {name:'Jack'}) SET j.hobby = "Playing the guitar";
为了向节点添加新属性,我编写了类似1)的查询。我把它换成了双引号,比如2),因为单引号出现了错误。但是,2)查询也会导致错误。
如何向节点添加新属性?