This leads to compilation issues when adding autopopulate to these options
: error TS2345: Argument of type '{ ref: string; localField: string; foreignField: string; justOne: false; autopopulate: boolean; }' is not assignable to parameter of type 'VirtualTypeOptions'.
Object literal may only specify known properties, and 'autopopulate' does not exist in type 'VirtualTypeOptions'.
Mongoose 5.12.14 introduced the new
VirtualTypeOptions
type for populate methods. https://github.com/Automattic/mongoose/pull/10350This leads to compilation issues when adding
autopopulate
to these options