franck34/mongoose-tree — pull request #1 by tomaash (2013-05-30 08:18:49+00:00)
Title: minLevel problem fix

If you want to get a tree with parent, which is not level 1, you needed to manually adjust minLevel to parent's level to get any result. Otherwise, it crashed on arr[nextIndex] undefined. This commit fixes the problem by adjusting minLevel to parent object's level(rootLevel)+1 if neccessary.

Just disregard the objectId commit, I don't have more time to do this pull request properly, maybe just for inspiration - you might run into this issue as well.