0

I have employee hierarchy data with

MATCH (user:Employee)
MATCH (manager:Employee )
MERGE(user)-[rep:REPORTSTO] -> (manager) where user.managerId=manager.userId;

I want to add two more properties to each node: left and right. The values are to be populated as per the nested set algorithm (image in this question)

How can I do this with cypher?

Sujay DSa
  • 1,172
  • 2
  • 22
  • 37
  • An advantage of using a graph DB like neo4j is that you can directly operate on a hierarchy, and don't need to use the cumbersome nested set algorithm. Is this a real requirement? – cybersam Nov 06 '19 at 01:00
  • @cybersam unfortunately we're using a third party visualization tool which only accepts data in relational format. so we compute those left and right values and push it to the tool to extract the required data for any heirarchy – Sujay DSa Nov 07 '19 at 04:14

0 Answers0