Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将mongoose.model(xxx,xxx)导出为TypeScript类_Typescript_Export_Mongoose Schema - Fatal编程技术网

如何将mongoose.model(xxx,xxx)导出为TypeScript类

如何将mongoose.model(xxx,xxx)导出为TypeScript类,typescript,export,mongoose-schema,Typescript,Export,Mongoose Schema,是否将mongoose.model(xxx,xxx)导出为TypeScript类? 你能帮我吗? 非常感谢 store\u entity.ts export const StoreSchema:Schema=新架构({ 姓名:{ 类型:字符串 } }, { 自动创建:对, versionKey:false } ); 索引({name:1},{unique:true}); export const StoreEntity=mongoose.model('store',StoreSchema,'st

是否将mongoose.model(xxx,xxx)导出为TypeScript类? 你能帮我吗? 非常感谢

store\u entity.ts
export const StoreSchema:Schema=新架构({
姓名:{
类型:字符串
}
}, {
自动创建:对,
versionKey:false
}
);
索引({name:1},{unique:true});
export const StoreEntity=mongoose.model('store',StoreSchema,'store');
test.ts
从“./store_entity”导入{StoreEntity};
功能显示(storeEntity:storeEntity){
console.log(storeEntity);
}
但我有一个错误提示:

'StoreEntity' refers to a value, but is being used as a type here.ts(2749)
在test.ts中