2

How to set a schema's key / value to null?

var TheModelSchema = new Schema({
  someNullKey: null, // is this possible?
  someDate: Date,
  someString: String,
})

Docs looked at:

Other questions looked at:

Community
  • 1
  • 1
jmunsch
  • 22,771
  • 11
  • 93
  • 114
  • 9
    What the sense? BTW define it as `{type:String, default: null}` – michelem Sep 08 '15 at 16:43
  • 1
    @Michelem Great thanks. I am going with `{type: Boolean, default: null}`. The endpoint I am trying to hit is asking for `null` and is suppose to return a boolean. Not sure what the sense. Your comment is an answer, I would like to accept. I had a hard time googling for an answer to this. – jmunsch Sep 08 '15 at 16:57

0 Answers0