Recent | Popular
#mongodb #virtual #populate
userSchema.pre('find', function (next) { if (this.options._recursed) { return next(); } this.populate({ path: "followers following", options: { _recursed: true } }); next(); });
Thu Feb 16 2023 11:39:22 GMT+0000 (Coordinated Universal Time) https://mongoosejs.com/docs/populate.html#populate-virtuals