[英]Where with OneToMany relation in TypeORM
如何在 TypeORM 中創建function以在OneToMany
實體中按時間范圍查找數據?
我創建了一個where
子句來查找:
const users = await this.conn
.getRepository(User)
.find({
select: ['id', 'firstName', 'lastName', 'sex', 'birthdate', 'subAddress', 'address', 'city', 'district', 'disabilityType'],
join: {
alias: "user",
leftJoinAndSelect: {
order: "user.orders"
}
},
where: {
order.createdAt: Between(dto.from, dto.to)//HERE
}
});
但它不起作用,總是把我扔到NOT_FOUND
:/
有人可以展示這應該是怎樣的嗎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.