Did you know you can access the save operations' options (session, validateModifiedOnly, etc.) from save hooks?
2nd parameter to pre('save') callback 😎
More about middleware 👉 mongoosejs.com/docs/middlewa…#NodeJS#MongoDB#JavaScript
Mongoose 7.2.0 released
⭐ Add flattenObjectIds option to toObject() and toJSON()
⭐ Add translateAliases option to automatically call translate aliases on query fields
Full changelog: github.com/Automattic/mongoo…#NodeJS#MongoDB#JavaScript