Closed sayeed1999 closed 1 year ago
I have a Skills collection each skill has a similar skills array so I am autopopulating the Skill inside similarSkills which is also a skill
so it is getting infinite loop and autopopulating on three four layers deep. can we restrict it to one layer deep only?
Yes, use the maxDepth option: https://github.com/mongodb-js/mongoose-autopopulate/blob/master/examples.md#it-can-limit-the-depth-using-maxdepth
maxDepth
I have a Skills collection each skill has a similar skills array so I am autopopulating the Skill inside similarSkills which is also a skill
so it is getting infinite loop and autopopulating on three four layers deep. can we restrict it to one layer deep only?