Prerequisites
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:
- Leave it as is - different automatic schema inference in
new Schema() and Schema.create(). Pick which one works for you.
- Replace
new Schema() schema inference with what Schema.create() does
- 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.
- Remove
Schema.create() entirely and leave the current automatic schema inference.
@hasezoey @AbdelrahmanHafez what do you think?
Prerequisites
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:new Schema()andSchema.create(). Pick which one works for you.new Schema()schema inference with whatSchema.create()doesnew Schema()- if you usenew Schema(), you are responsible for specifying some/all generics yourself.Schema.create()provides automatic schema inference.Schema.create()entirely and leave the current automatic schema inference.@hasezoey @AbdelrahmanHafez what do you think?