add note about selecing specific columns
ci/woodpecker/push/lint-backend Pipeline was successful Details
ci/woodpecker/push/lint-client Pipeline was successful Details
ci/woodpecker/push/build Pipeline was successful Details
ci/woodpecker/push/lint-foundkey-js Pipeline was successful Details
ci/woodpecker/push/test Pipeline was successful Details

This commit is contained in:
Johann150 2022-09-11 22:01:42 +02:00
parent 515957ee74
commit 09818f425c
Signed by: Johann150
GPG Key ID: 9EE6577A2A06F8F1
1 changed files with 6 additions and 0 deletions

View File

@ -270,6 +270,12 @@ const users = userIds.length > 0 ? await Users.find({
}) : [];
```
### typeorm: selecting only specific columns
If you select specific columns of a table only, you will probably not be able to use the usual `getOne`, `getMany` etc.
Instead you might want to try using `getRawOne` and `getRawMany`.
For that, you may also want to add aliases to the columns you select, which can be done using the second parameter of `select` or `addSelect`.
### Array indexing in SQL
PostgreSQL array indices **start at 1**.