我可以创建一个唯一的节点并在同一个批处理操作中设置标签吗?
我尝试用这个json做但不幸的是服务器失败了
[
{
"id": 0,
"method": "POST",
"to": "/index/node/PhoneBook?uniqueness=get_or_create",
"body": {
"key": "mobilePhone",
"value": "9999999999",
"properties": {
"firstName": "fn1",
"lastName": "ln1",
"mobilePhone": "9999999999"
}
}
},
{
"method": "POST",
"to": "{0}/labels",
"body": [
"Contact"
]
}
]
答案 0 :(得分:1)
改为使用cypher:
MERGE (p:PhoneBook {mobilePhone:{phoneNo}}
ON CREATE SET p += {properties}, SET p:Contact
params:
{phoneNo: "9999999999", "properties": {
"firstName": "fn1",
"lastName": "ln1",
"mobilePhone": "9999999999"
}