forked from FoundKeyGang/FoundKey
add note about selecing specific columns
This commit is contained in:
parent
515957ee74
commit
09818f425c
1 changed files with 6 additions and 0 deletions
|
@ -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**.
|
||||
|
||||
|
|
Loading…
Reference in a new issue