neo4j - auto multi-level tree with cypher -


I am currently doing this Neo4j schema: A node is connected to another by a relation "content". Suppose I do not know how much level I want.

For now, I have this question:

  MATCH (P: keywords) Alternate match (P) - [: content] - & gt; (P1) Alternative Match (P1) - [: Content] - & gt; (P2) Alternative Match (P2) - [: Content] - & gt; (P3) P4 with optional match (P3) - [: Content: PTI, P1, P2, P3, {UID: P4, UID, Name: P 4.name} P1, P2, {UID: P3.UID, Name: P3) .name, children: P1 as Parent, P1, (UID: P2UID, Name: P2Name, children : Collect (child 3)} as child with P 2, {uid: p1.uid, name: P1.name, children: Submit (child 2) as a child {UID: P. UID, name : P. Names, Children: Submit as Bal Returns (Child 1)} {Tree: Deposit (Children)}  

What I'm doing is the result, but in this way, I limit my results to 5 levels. How can I set up this question multiple-level without any help?

Thank you for your help :)

fully understand what the desired output of your query should be.

:

MATCH path = (P: keyword) - [: content * 0..5] - & gt; (Content) // match 0 to 5 material return path, in the form of length // in the form of LAN only proceed with the longest path

Edit:

  match path = (P: keyword) - [: content * 0..4] - & gt; (Content) - [: content] - & gt; (Child) return content. UID, collect as children (child.uid)  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -