How to really set a Mongoose default, esp. Boolean?
问题 I have the following schema: const profileSchema = new Schema({ created: { type: Date, default: Date.now }, readonly: { type: Boolean, default: false } }); const Profile = mongoose.model('profile',profileSchema); However I have found that if I query for "date", the date is set on documents, but if I query for "readonly" it is NOT set to false, but will return false on the document. For example: Profile.find({readonly: false}) Will return no documents. However, if I do: Profile.find({}) I will