I want to do something similar to this but it doesn't work:
Code:
userSchema.pre(/^find/, async function (next) { if (this.role !== "admin") { this.find({ active: true }); } next(); });