Reusing Mongoose schemas, but want to skip nested indexes?
Use the `excludeIndexes` option. Here's a case where we want to reuse a `PromoCode` model's schema, but want to skip the unique index on `PromoCode.code`
#NodeJS#MongoDB#JavaScript
Pro tip: use Mongoose virtuals to move repetitive frontend calculations into your schema.
For example, here's some virtuals we use to compute ecommerce cart totals
More on virtuals 👉 mongoosejs.com/docs/tutorial…#NodeJS#MongoDB#JavaScript
Mongoose 6.7.1 released:
🛠️ Select Map field with select: false when explicitly requested
🛠️ Correctly find paths underneath single nested document with an array of mixed
Full changelog: github.com/Automattic/mongoo…#NodeJS#MongoDB#JavaScript