I have a recursively nested schema just like comments work on a blog. What is the best way to pull an individually nested document out which may be several layers deep.
I understand that you get the root document out, then drill down to the document you want, but in a recursive situation where the wanted document may be an unknown number of levels deep how should I retrive it. Loop through and do an if to see if its the correct one…?
looks like there is no mongoose way to do it so im using a recursive find function like this for finding a folder which is nested:
p.s. this uses the underscore library