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.