How do I define setter for schema property after I have defended schema like
var User = new Schema({email:String})
How do I define setter for that email
property like:
User.email.setter(function ...)
?
I found the solution. Custom properties can be set like
User.path("email", {
set: function(email) {
return email
}
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With