Closed AlexBatorykLeliw closed 8 years ago
My schema is something along these lines:
var userSchema = new mongoose.Schema({ email: String, password: String, children: [ { type: mongoose.Schema.Types.ObjectId, ref: 'users' } ] });
Therefore I'm storing my ObjectIds inside the 'children' array, but these are recursive and users can go into other users.
The deepPopulation request is as such:
User.deepPopulate(req.user, 'children', function(err, users){ if(err) return next(err); res.json(users); });
Only the first instance is getting populated and all others are remaining with the array of ObjectId's. Can you please see if it is any issue of mine, or if the plugin is not working?
Thank you
My schema is something along these lines:
Therefore I'm storing my ObjectIds inside the 'children' array, but these are recursive and users can go into other users.
The deepPopulation request is as such:
Only the first instance is getting populated and all others are remaining with the array of ObjectId's. Can you please see if it is any issue of mine, or if the plugin is not working?
Thank you