These are chat archives for LearnBoost/mongoose

Jan 2015
Jan 30 2015 21:05 UTC
Hey there! I´d like to auto-populate my referenced data. Can I add a function to my Schema to do that for me?
Valeri Karpov
Jan 30 2015 22:37 UTC
@Meistercoach83 4.0.0-rc0 was just released today, it includes hooks for queries. You can do something like schema.pre('findOne', function() { this.populate('pathToPopulate'); });. See tests for an example: