gpt4 book ai didi

neo4j - 如何通过 REST API 查看 Neo4j 的 DELETE 是否成功?

转载 作者:行者123 更新时间:2023-12-01 09:51:02 25 4
gpt4 key购买 nike

我如何通过 REST API 查看 Neo4j 的 DELETE 是否成功?这是我的查询。

MATCH (from_user:User),(to_user:User)
WHERE from_user.id = '522fed61e4b0a1f88d599ae0' AND to_user.id = '52b9f410e4b03902bd21629e'
MATCH from_user-[r]->to_user
DELETE r

通过 REST,无论是否删除了任何内容,我都会得到以下响应。
{
"results": [
{
"columns": [],
"data": []
}
],
"errors": []
}

最佳答案

将此添加到您的 POST 正文

"includeStats":true

例如,
[
{
"statement": "MATCH (from_user:User),(to_user:User) WHERE from_user.id = '522fed61e4b0a1f88d599ae0' AND to_user.id = '52b9f410e4b03902bd21629e' MATCH from_user-[r]->to_user DELETE r",
"parameters": {},
"includeStats": true
}
]
}

获取数据,例如
"stats" : {
"relationships_created" : 0,
"nodes_deleted" : 0,
"relationship_deleted" : 0,
"indexes_added" : 0,
"properties_set" : 0,
"constraints_removed" : 0,
"indexes_removed" : 0,
"labels_removed" : 1,
"constraints_added" : 0,
"labels_added" : 1,
"nodes_created" : 0,
"contains_updates" : true

}

背部。这适用于事务性密码端点。
如果您使用的是旧版密码端点,请参阅 http://neo4j.com/docs/2.2.1/rest-api-cypher.html#rest-api-retrieve-query-metadata

关于neo4j - 如何通过 REST API 查看 Neo4j 的 DELETE 是否成功?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30308842/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com