Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

mongoose nullable

var userSchema = new mongoose.Schema({
  name: {type: String, required: true},
  preferences: {type : { preference1 : String, preference2 : String}, default : null}
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mongoose #nullable
ADD COMMENT
Topic
Name
3+9 =