小编Exo*_*Exo的帖子

未找到 TypeORM 实体元数据

嘿嘿,

\n

我正在尝试使用 NestJS + TypeORM 为某种类型的电子商务网站构建后端。

\n

我需要我的订单和产品表之间的 am:n 关系。然而,由于我需要数据透视表中的一些自定义字段,我查找了 typeorms 文档,并且如上所述,我需要创建一个我完成的新实体。现在我在启动 NestJS 应用程序时遇到错误:

\n
Error: Entity metadata for Product#productToOrders was not found. Check if you specified a correct entity object and if it\'s connected in the connection options.\n
Run Code Online (Sandbox Code Playgroud)\n

我的产品.entity.ts:

\n
Error: Entity metadata for Product#productToOrders was not found. Check if you specified a correct entity object and if it\'s connected in the connection options.\n
Run Code Online (Sandbox Code Playgroud)\n

我的productToOrder.entity.ts

\n
import { BaseEntity, Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm";\nimport …
Run Code Online (Sandbox Code Playgroud)

postgresql typescript typeorm nestjs

6
推荐指数
2
解决办法
2万
查看次数

标签 统计

nestjs ×1

postgresql ×1

typeorm ×1

typescript ×1