#16050·mongoose

Automatic type inference for Mongoose 10 discussion - the future of Schema.create()

Author: vkarpov15Created Feb 27, 2026Updated Mar 12, 2026
Labelsdiscussiontypescript

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the issue has not already been raised

Issue

We introduced Schema.create() in 9.0 as an experiment in how automatic schema type inference should work going forward. We have a couple of options in Mongoose 10:

  1. Leave it as is - different automatic schema inference in new Schema() and Schema.create(). Pick which one works for you.
  2. Replace new Schema() schema inference with what Schema.create() does
  3. Remove automatic schema inference from new Schema() - if you use new Schema(), you are responsible for specifying some/all generics yourself. Schema.create() provides automatic schema inference.
  4. Remove Schema.create() entirely and leave the current automatic schema inference.

@hasezoey @AbdelrahmanHafez what do you think?