best way to replicate a tree structure in firebase?

Viewed 46

This is kind of a weird and perhaps dumb question but regardless some clarification is appreciated. I'm trying to implement a tree-like structure in firebase but don't really know the best method to do so.

The best solution that I have come up with is nested maps but I feel like this is a pretty shitty one. Heres a screenshot to show you what I did:

enter image description here

this is trying to replicate the following:

enter image description here

Feel like there's gotta be a better method than this, if anyone has experience with a similar situation please guide me!

0 Answers
Related