MikroORM Eagle设置为false,但关系仍在加载中



我有以下实体:

@Entity()
export class SomeEntity extends BaseEntity implements ISomeEntity {
@ManyToOne(() => OtherEntity, {
nullable: true,
eager: false
})
otherEntity: OtherEntity;
}

但是当运行findOnefind函数时,otherEntity仍然被加载。

我不知道如何在不影响where条件的情况下停止加载其他关系。因为这会导致循环问题。

基于这里的装饰师https://mikro-orm.io/docs/decorators/#manytoone

渴望布尔值yes始终加载关系。

显然,在MikroORM中,它链接了以前自动加载的任何关系,而不考虑是否急切。这是根据文件设计的。

最新更新