mongoose: Cast to number failed for value "undefined"
Hi, with the latest version of mongoose, I have a mysterious problem. If I want to save document without specific typed field because it’s not required, mongoose return this error in my face :
Cast to number failed for value "undefined" at path "parent"
This is my model schema. It works fine in 3.8.24 :
var schema = mongoose.Schema({
code : { type : String },
plang : { type : String, required: true },
langs : [ { type : String, required : true } ],
parent : { type: Number }
});
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 3
- Comments: 29 (2 by maintainers)
For me this is clearly a bug! Consider this code: