Is there any option to make exceptions for the unique property? I dont want MongoDB to set null
if the value wasn't submitted or to make a exception for the null
value in case of uniqueness.
userSchema = mongoose.Schema({
/* ... additional Schema properties ... */
email: {type: String, lowercase: true, unique: true}
});
It would be nice and easy if I could set the exception in the mongoose.Schema. Obviously, every other solution is appreciated as well. Thanks for your time! It helps me a lot. :)