简体   繁体   中英

Neo4j post-order state

I want to do something like this in Neo4j using the Java API (not a cypher query]. Say I have a graph which is a simple path looking like this:

[5]->[4]->[3]->[2]->[1]->[0]

and I want to output a String "012345" but starting the traversal from the node [5]. This means I need something like post-order traversal while keeping an intermediate string at each node. However, I do not want to create some kind of map from nodes to strings. Is such a thing possible with the traversal API of Neo4j? For example by using states?

Thanks.

您可以从节点[5]遍历以获取路径[5] - > [0],然后使用函数path.reverseNodes()以相反的顺序获取路径上的节点。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM