Type validation
const userSchema = new Schema({
name: { type: String },
lastname: { type: String },
password: { type: String },
email: { type: String },
company: { type: Schema.Types.Key, ref: 'Company' },
votes: { type: Number },
dateOfBirth: { type: Date },
createdOn: { type: Date },
modifiedOn: { type: Date }
});Last updated
Was this helpful?