使用nodejs“新4j-驱动程序”:"^1.1.1“
是否有一种在返回节点数据之前临时格式化节点数据的方法?首先,我希望在将id返回给客户端之前删除它。我不确定返回的id是neo4j本身的一部分还是新4j驱动程序的一部分,在任何情况下,这个问题对于任何属性都是正确的。
一般来说,我具体地布局了我想返回的内容:
RETURN {
uuid: n.uuid,
name: n.name,
etc...
}但是我遇到了一种情况,我需要返回未知节点,但希望确保它没有一些特定的属性。我想在返回之前暂时删除这些属性--我不想使数据库中的更改永久化。--我意识到我可以在服务器上的代码中这样做,但是我很好奇用Neo4j来做这件事。
例如:
MATCH (n)
WITH n AS node // I thought about using properties(n) AS node, but then I can't find in the documentation how to modify MAP properties without using a third party plugin. I'm sure there is something in APOC, I haven't looked yet.
REMOVE node.id, node.name // I want this to only temporarily remove the property for purposes of returning, not alter it in the database.
RETURN node在neo4j中是否有类似的东西可供使用,或者我是否应该继续在代码中手动执行呢?
发布于 2017-05-12 06:13:23
为此,您可能需要APOC过程,因为它的地图辅助函数应该是有用的。
match (n)
return apoc.map.removeKeys(n, ['id', 'name']) as nhttps://stackoverflow.com/questions/43929321
复制相似问题