Home > Enterprise >  Defining types in mongoose schema
Defining types in mongoose schema

Time:01-01

For a mongoose schema, is there a difference between name: String and name: { type: String } when defining types?

CodePudding user response:

In Mongoose, name: String is just a shorthand for name: {type: String}. Both versions are perfectly valid.

  • Related