I have Category model:
Category:
...
articles: [{type:ObjectId, ref:\'Article\'}]
Article model contains ref to
Easiest way to accomplish this in 3.6 is to use Model.populate.
User.findById(user.id).select('-salt -hashedPassword').populate('favorites.things').exec(function(err, user){
if ( err ) return res.json(400, err);
Thing.populate(user.favorites.things, {
path: 'creator'
, select: '-salt -hashedPassword'
}, function(err, things){
if ( err ) return res.json(400, err);
user.favorites.things = things;
res.send(user.favorites);
});
});