场景

需要实现如下的场景:

传入的变量值通过对应的值拼接。

正确的写法

写法

  [plaintext]
1
2
3
4
5
6
7
WITH 'Hello, ' AS firstName, 'world!' AS lastName CREATE (p:Person { firstName: firstName, lastName: lastName, fullName: firstName + '-' + lastName }) RETURN p

效果

  [plaintext]
1
2
3
4
5
6
7
8
9
10
11
12
{ "identity": 175, "labels": [ "Person" ], "properties": { "firstName": "Hello, ", "lastName": "world!", "fullName": "Hello, -world!" }, "elementId": "175" }

参考资料