【发布时间】:2016-05-10 16:05:26
【问题描述】:
我一直在使用 Mongoose 向我的字段添加验证,但是当我测试它时,Mongoose 说我没有通过 _id 属性中的最大验证
var userSchema = new mongoose.Schema{
_id : {
type : number,
min:[6,"Your id is too short"],
max:[10,"Your id is too large"]
//This is the validation that sends
// me when I put 2013090464 (10 digits)
}
}
【问题讨论】: