Javascript typeorm返回字段中的find函数带有下划线__
我已将TypeForm中的实体定义为:Javascript typeorm返回字段中的find函数带有下划线__,javascript,node.js,typescript,typeorm,Javascript,Node.js,Typescript,Typeorm,我已将TypeForm中的实体定义为: @Entity('foo', { schema: 'dbo' }) export class Foo extends BaseEntity { ... @ManyToMany(() => Bar, (bar) => bar.some, { lazy: true }) bars: Promise<Bar[]> } 这是typeorm的正常行为?如果没有,如何修复?激活延迟加载导致的问题{lazy:true},仅供参考,
@Entity('foo', { schema: 'dbo' })
export class Foo extends BaseEntity {
...
@ManyToMany(() => Bar, (bar) => bar.some, { lazy: true })
bars: Promise<Bar[]>
}
这是typeorm的正常行为?如果没有,如何修复?激活延迟加载导致的问题{lazy:true},仅供参考,他们可能会放弃此功能,作为解决方案,您可能会删除此功能或为结果制作映射
PS:尽管我尝试了类似的情况,甚至得到了下划线,但我通过执行
结果得到了条。条
是由激活延迟加载{lazy:true}
引起的,仅供参考,他们可能会放弃此功能,作为解决方案,您可以删除此功能或为结果制作地图
PS:尽管我尝试了类似的情况,甚至得到了下划线,但我还是通过执行结果得到了条。条
const results = await Foo.find({ relations: ['bars'] });
results.__bars__ // <--------- this should be just `bars`.