mirror of
https://github.com/typeorm/typeorm.git
synced 2025-12-08 21:26:23 +00:00
docs: update select-query-builder.md (#10520)
To use alias as the first argument in the createQueryBuilder method, the entity must be imported into the getRepository method to be used.
This commit is contained in:
parent
d184d8598c
commit
c8ec5429eb
@ -74,6 +74,7 @@ When using the `QueryBuilder`, you need to provide unique parameters in your `WH
|
||||
|
||||
```TypeScript
|
||||
const result = await dataSource
|
||||
.getRepository(User)
|
||||
.createQueryBuilder('user')
|
||||
.leftJoinAndSelect('user.linkedSheep', 'linkedSheep')
|
||||
.leftJoinAndSelect('user.linkedCow', 'linkedCow')
|
||||
@ -85,6 +86,7 @@ const result = await dataSource
|
||||
|
||||
```TypeScript
|
||||
const result = await dataSource
|
||||
.getRepository(User)
|
||||
.createQueryBuilder('user')
|
||||
.leftJoinAndSelect('user.linkedSheep', 'linkedSheep')
|
||||
.leftJoinAndSelect('user.linkedCow', 'linkedCow')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user