Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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
});
 
PREVIOUS NEXT
Tagged: #mongoose #populate #array #ids
ADD COMMENT
Topic
Name
4+4 =