我在使用neo4j.rb,当我运行
MATCH (a {name:'apple'}) SET a.flag = true我想获得响应数据,其内容如下:
{
"results": [
{
"columns": [],
"data": [],
"stats": {
"contains_updates": true,
"nodes_created": 0,
"nodes_deleted": 0,
"properties_set": 1,
"relationships_created": 0,
"relationship_deleted": 0,
"labels_added": 0,
"labels_removed": 0,
"indexes_added": 0,
"indexes_removed": 0,
"constraints_added": 0,
"constraints_removed": 0
}
}
],
"errors": []
}相反,我什么也得不到--对象是空的,我想是因为我不是要求返回节点,而是想要查询结果上的元数据。
这里有一个建议的解决方案,使用py2neo (py2neo return number of nodes and relationships created)和includeStats: true,我还尝试将它附加到我用来以?includeStats=true身份运行查询的地址,这是我在其他地方看到的,并导致服务器没有可用的错误(响应代码302 / RuntimeError)。有使用neo4j.rb的解决方案吗?
发布于 2016-04-11 06:47:27
不幸的是,当返回neo4j-core gem中的结果时,我们没有保留元数据。这可能是一些很容易添加的东西。也许您可以创建一个问题:
https://github.com/neo4jrb/neo4j-core/issues
当然,拉请求是受欢迎的!
https://stackoverflow.com/questions/36535981
复制相似问题