我的架构文件在这里
import * as mongoose from "mongoose";
export const memberAddressSchema = new mongoose.Schema({
mumber_id: { type: String, required: true },
city_id: { type: String, required: true },
state_id: { type: String, required: true },
pincode: { type: String, required: true },
address: { type: String, required: true },
});
无法读取未定义(阅读“tree”)的属性类型错误:无法读取未定义的属性(阅读“tree”)
@Module({
imports:[MongooseModule.forFeature([{name:'Admin', schema:adminSchema},{name:'Member',schema:memberAddressSchema}])],
providers:[AdminService,MemberAddressService],
exports:[AdminService,MemberAddressService]
})
export class AdminModule{}```
1条答案
按热度按时间ckocjqey1#
当我错误地将schema添加到
@Module
的imports
数组时,我得到了这个错误。我删除了它,它修复了这个问题。