-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Open
Description
Issue type:
[ x] question
[ ] bug report
[ ] feature request
[ ] documentation issue
Database system/driver:
[ ] cordova
[ ] mongodb
[ ] mssql
[x] mysql / mariadb
[ ] oracle
[ ] postgres
[ ] cockroachdb
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo
TypeORM version:
[x] latest
[ ] @next
[ ] 0.x.x (or put your version here)
The above will return the User, but without the lastPurchase property
const users = await this.repository.createQueryBuilder("user")
.leftJoinAndMapOne("user.lastPurchase", (subQuery) => {
return subQuery
.select()
.from(Purchase, "purchase")
.orderBy("created", "DESC");
}, "purchase", "purchase.userId = user.id")
.getManyAndCount();
any ideas?
aseleznev, j1i-ian, brunnerh, ruciu, Form1ca and 7 more