How to make the population of the mongoose document?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
19 views
how can I do this population?
User.find({id: 123}, function(err, user) { user.populate('vk_account').populate('ok_account')... })

or do I have to do this?
User.find({id: 123}, function(err, user) { vk_account.find({user_id: 123}) ok_account.find({user_id: 123}) ... })
by | 19 views

1 Answer

0 like 0 dislike
How about to read documentation mongoosejs.com/docs/populate.html ?
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,187 answers
0 comments
40,796 users