Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

mongoose populate selected fields

Model
.find(query)
.populate({
  path: 'key_with_ref', 
  select: ['field_1', 'field_2']
});
 
PREVIOUS NEXT
Tagged: #mongoose #populate #selected #fields
ADD COMMENT
Topic
Name
3+7 =