defult null to a schema mongoose code example
Example: mongoose nullable
var userSchema = new mongoose.Schema({
name: {type: String, required: true},
preferences: {type : { preference1 : String, preference2 : String}, default : null}
});
var userSchema = new mongoose.Schema({
name: {type: String, required: true},
preferences: {type : { preference1 : String, preference2 : String}, default : null}
});