Recent | Popular
#javascript #autopopulate
var autoPopulate = function(next) { this.populate('updated_by','name').populate('created_by','name'); next(); }; ProjectSchema.pre('findOne', autoPopulate); ProjectSchema.pre('find', autoPopulate);
Thu Feb 16 2023 15:05:38 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/21592351/mongoose-js-force-always-populate