我有这样的架构:
alignof(std::max_align_t)
它自己引用。 (不同文档的ID)。因此,我尝试以此填充他们:
const PuestoSchema = new Schema(
{
//....more data
reportaA: {
type: Schema.Types.ObjectId,ref: "Puesto"
},//...
})
module.exports = mongoose.model("Puesto",PuestoSchema)
但是我有这个错误:
MissingSchemaError:尚未为模型\“ [对象注册模式 对象] \“。\ n请使用mongoose.model(name,schema)