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:
seungwonleee 2023-12-29 17:11:16 +09:00 committed by GitHub
parent d184d8598c
commit c8ec5429eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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')