How to populate nested entities in mongoose?
You can try chaining populate operations
User.find().populate("roles.role").populate("roles.role.roleEntities.entity")
Here's an extreme example of a deep populate nested inside of multiple objects/arrays:
Deal.find() .populate({ path: 'fund', populate: [{ path: 'organizer', populate: { path: 'banking.accounts.transactions.associatedInvestment', model: 'Investment' } }, { path: 'documents' }] })
Mongoose 4 :
User .find() .populate({ path: 'roleIds', model: 'roles', populate: { path: 'otherIds', model: 'other' } })