Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to refrence schema in my mongoose schema with populate function

Person
.findOne({ firstname: 'Aaron' })
.populate('eventsAttended') // only works if we pushed refs to person.eventsAttended
.exec(function(err, person) {
    if (err) return handleError(err);
    console.log(person);
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #refrence #schema #mongoose #schema #populate #function
ADD COMMENT
Topic
Name
5+3 =