Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Mongoose populate example

const members = await subtable.find({ party: req.body.party }).populate({
    path: "user_id", //subtable field which refers to your main table
    select: "fname lname",
  });
Source by mongoosejs.com #
 
PREVIOUS NEXT
Tagged: #Mongoose #populate
ADD COMMENT
Topic
Name
2+8 =