Mongodb Database structure on an MLM application

Please I need help structuring my MongoDB database for a Multi Level Marketing Application my team and I are currently working on. We’re using Express for our server and MongoDB for the database. Here is my use case:

    1. I want a tree structure of a parent with Left and Right children, where each child will have another set of Left and Right Children. This process should be continued for each child.
  • I want when there is a user at the Left and Right node of each parent, a matching bonus should be paid to the parent.

  • How to use mongoose to get each parent tree with all children

HERE is a sample structure of a parent with children

It would be of great help if I could get a response from the community. Thank to anyone that could help, God, bless.

hi, Is your problem solved?

hey! also wanted to implement this. currently trying to figure it out with bard. were you able to solve it?