Search code examples
c#neo4jneo4jclient

Get hierarchical data neo4jclient


I have 3 classes. They are related hierarchically. How get hiearchiacal data and union it it one class or dictionary array? I lately want insert data to treeview

3 classes

  1. class Lvl1 {string name}
  2. class Lvl2 {string name}
  3. class Lvl3 {string name}

picture of the schema


Solution

  • You can try to do:

    MATCH (root:Lvl1)-[:HAVE_LVL2|HAVE_LVL3*0..]->(leaf)
    RETURN distinct leaf