Answers for "mongoose populate array of ids"

0

mongoose populate array of ids

Use the name of the schema path instead of the collection name:

Conversation.findOne({ _id: myConversationId})
.populate('recipients') // <==
.exec(function(err, conversation){
    //do stuff
});
Posted by: Guest on March-23-2021

Code answers related to "mongoose populate array of ids"

Browse Popular Code Answers by Language