我有以下解释的猫鼬报价模型:
const OfferSchema = new Schema({
sections: [
{
title: String,
},
],
});
引用了第一个方案要约的和订单方案如下:
const OrderSchema = new Schema({
offers: [
{
offer: { type: Schema.Types.ObjectId, ref: 'Offer' },
sections: [
{
section: { type: Schema.Types.ObjectId, ref: 'Offer.sections' }, // issue here
},
],
},
],
});
我无法在此处{section: { type: Schema.Types.ObjectId, ref: 'Offer.sections' }}
填充部分的问题
它给了我MissingSchemaError: Schema hasn't been registered for model "Offer.sections".
那么有什么方法可以填充节吗?