Can someone tell me why I can't use relation
in my createQuerybuilder
:
let user = await this.conn.getRepository(UserEntity)
.createQueryBuilder('user')
.relation('orders')
.orderBy('user.id', 'ASC') // 'Property 'orderBy' does not exist on type 'RelationQueryBuilder<UserEntuty>.
my error is throwing at .orderBy
, but is not problem with orderBy because when i put in this place a diffrent function, this error is still exists
thanks for any help
leftJoin()
orinnerJoin()
instead ofrelation()
. It will be smth like thatawait this.conn.getRepository(UserEntity).createQueryBuilder('user').innerJoin('user.orders', 'order').orderBy('user.id', 'ASC')
– Art Olshansky