nAuth-restful-api
nAuth-restful-api copied to clipboard
定义Schema时不可为空约束应该是 required,而不是 require吧
const UserSchema = new Schema({ name: { type: String, unique: true, // 不可重复约束 required: true // 不可为空约束 }, password: { type: String, required: true }, token: { type: String } });