Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

mongoose populate filter

Story.
  find(...).
  populate({
    path: 'fans',
    // filtering field, you can use mongoDB syntax
    match: { age: { $gte: 21 } },
    // Explicitly exclude `_id`, see http://bit.ly/2aEfTdB
    select: 'name -_id'
  }).
  exec();
Source by mongoosejs.com #
 
PREVIOUS NEXT
Tagged: #mongoose #populate #filter
ADD COMMENT
Topic
Name
2+5 =