2016-05-10 101 views
0

我一直在增加验证到我的领域与猫鼬但是当我测试了一下,猫鼬说我,说我没有通过验证最大的_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) 
     } 
    } 

回答