Monday, 29 May 2017

How extract the complete trees in order with cypher

I have different tree structure in DB.

All of them have 
- one node(:Module) 
- some node(:CATEGORY) 
- linked by the relation[:FOLLOWED_BY]

Here is one of them.

    O                       O => (:MODULE)
    |                       0 => (:CATEGORY)
    0                       | => [:FOLLOWED_BY]
    |                      
    0    
    | \
    0  0
    | /
    0  
  / | \
 0  0  0

And I need to recover the data for my front like this:

[ [nodeA], [nodeB], [nodeC], [nodeD, nodeE], [nodeF], etc ...]

I tried to sort the data with cypher or with my back (nodeJs) but I failed each time.

// I tried to hang myself with the power cord of my pc, but I still failed

Is there anyone who ever did it , or have an idea ?



via Svez Day

No comments:

Post a Comment