我弄的Schema如下,加了一些验证, 另外也试过了UserSchema.path(‘name’).validate(function (name){})但这个验证是之后执行的,错误会被定义Schema时的验证先捕获,然后只给出“validate error",也不给出哪项validate error, 有没有 自定义的验证错误提示信息的方法? var UserSchema = new Schema({ id: ObjectId , name: { type: String, trim: true, required: true } , username: { type: String, trim: true, lowercase: true, required: true, unique: true } , phoneNumber: { type: String, trim: true, required: true , unique: true } , hashed_password: { type: String, trim: true } , tempPasswordFlag: { type: Boolean, default: false } , email: { type: String, trim: true, lowercase: true, required: true, unique: true } , newEmail: { type: String, trim: true, lowercase: true, default: ‘’ } , emailValidatedFlag: { type: Boolean, default: false } , role: { type: String, enum: ['User’, 'Subscriber’, ‘Admin’], default: 'User’, required: true } , update_date: { type: Date, default: Date.now} //Create_date 通过objectId可以得到 id.getTimesstamp() , avatar: { type: String, trim: true } , imageId:{ type: ObjectId } //外键引入图片表内某一项 })