所以我的问题陈述是这样的: -我有一个对象的模式
const categorySchema = new mongoose.Schema({
name: {
type: String,
required: true,
unique: true,
minlength: 1,
maxlength: 100
},
parent: {
type: mongoose.Schema.Types.ObjectId,
ref: 'categorySchema'
}
});
error: MongooseError [MissingSchemaError]: Schema hasn't been registered for model "categorySchema".
谢谢!