【发布时间】:2021-06-24 16:02:01
【问题描述】:
category.ts
@Entity('categoryenter code here')
export class Category{
@PrimaryGeneratedColumn({ type: 'int' })
id: Category;
@OneToMany(() => Category, category => category.category,{eager:true})
categoryList: Category[];
@ManyToOne(() => Category, (category) => category.categoryList)
category: Category;
}
Category 实体在上面(mysql)。 我想找到一个像这样的所有孩子的类别
await categoryRepo.findOne({
where:{ id: 1 },
relations:['categoryList']
})
但是我收到了一个错误Maximum call stack size exceeded
我想做什么
【问题讨论】:
标签: node.js typescript nestjs typeorm