You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[X] latest
[ ] @next
[ ] 0.x.x (or put your version here)
I have a deletedAt column on my entities which are select: false. This works just fine for any select queries.
However, when using .save(), the returned values includes properties which are not supposed to be selected.
Is this standard behavior, or should this be considered a bug?
Reacted by Simon, Ardy Febriansyah, Adamnator, Piotr Gomoła, Alejandro Barone, kwasimensah, Kostiantyn, Mohammed Abulsoud, Martin Sotirov, Elias Torrealba and 23 more
Any updates on this? The workaround above is somewhat tedious and causes typing issues when attempting to return an instance of your entity missing expected fields. I can take a crack at it but unsure on direction. Has it been decided this is infact a bug and save() functionality should be fixed, or should we add a key, say returning: bool to ColumnOptions and make it an option without changing current functionality?
Which shouldn't happen. Is something going to be done ? Or do we have to use the workarounds ? Because I see that this issue has been open since 2019.
For info, I'm currently using these versions :
"@nestjs/typeorm": "^8.0.2" "typeorm": "^0.2.38"
Reacted by David Rodarte, Mickaël, Felix Dobler, Pietro Diana, Xavier Garnier, Alexander, nyo, Md Hasanuzzaman, SamAlhabash, Daniel Killenberger and 1 more
TypeORM has returned to active development after recently transitioning to new leadership (see related announcement).
As part of the new team's efforts to prioritise work on the project moving forward, it is necessary to clean up the backlog of stale issues.
🧹 This issue is being automatically closed because it has had no activity in the last 6 months.
If you believe this issue is still relevant, feel free to comment below and the maintainers may reopen it. Thank you for your contribution.
Activity
Redanski commentedon Feb 11, 2020
carlosempd commentedon Feb 20, 2020
ardyfeb commentedon Mar 30, 2020
kostia-official commentedon May 8, 2020
KevLehman commentedon May 31, 2020
Same here. What I'm doing is to use the rest operator to hide manually the properties. But this shouldn't be the way.
ablankenship10 commentedon May 25, 2021
Any updates on this? The workaround above is somewhat tedious and causes typing issues when attempting to return an instance of your entity missing expected fields. I can take a crack at it but unsure on direction. Has it been decided this is infact a bug and save() functionality should be fixed, or should we add a key, say
returning: booltoColumnOptionsand make it an option without changing current functionality?tkssharma commentedon May 28, 2021
How can I hide
supplier_profile foreign key Table datacoming in response after it savedmarking selected false won't work when we are doing same
Ojka91 commentedon Aug 16, 2021
Another workaround after the save() is to delete de property like this
await Entity.save(); delete Entity.password; return Entity;Indeed tedious to do...
laurent-brisbois commentedon Nov 5, 2021
In my User entity I have :
However when I'm doing :
with my service being :
I get this answer, with the password :
{ "firstName": "John", "lastName": "Doe", "email": "[email protected]", "password": "the undesired password", "id": 13 }Which shouldn't happen. Is something going to be done ? Or do we have to use the workarounds ? Because I see that this issue has been open since 2019.
For info, I'm currently using these versions :
"@nestjs/typeorm": "^8.0.2""typeorm": "^0.2.38"abigmiu commentedon Aug 17, 2022
when use
{select: false}.。// This column will not be selected by find functions and QueryBuilder
@column({select: false})
password: string
if you used in
save. i triedclass-transformerand add interceptor in controller
mahoo12138 commentedon Oct 7, 2022
Also in the sqlite driver 😕
bombillazo commentedon Oct 22, 2022
Updates on this issue? This poses a known security risk not even mentioned in the docs:

11 remaining items
github-actions commentedon Sep 18, 2025
TypeORM has returned to active development after recently transitioning to new leadership (see related announcement).
As part of the new team's efforts to prioritise work on the project moving forward, it is necessary to clean up the backlog of stale issues.
🧹 This issue is being automatically closed because it has had no activity in the last 6 months.
If you believe this issue is still relevant, feel free to comment below and the maintainers may reopen it. Thank you for your contribution.
qumberrizvi commentedon Jan 25, 2026
This issue is still relevant. Returning columns that were explicitly excluded from selection can be dangerous, especially for sensitive fields.
gioboa commentedon Jan 25, 2026
Thanks @qumberrizvi for the heads up. I will take a look at it.
alumni commentedon Jun 3, 2026
The behavior described in the issue as a "bug" was the intended behavior, we will restore it in both 0.3 and 1.0.
Even though the column has
select: false, if we remove the property, we will cause data loss for the users. See #12473.So if you don't want to keep the property after saving, you'd need to delete it yourself, but
select: falseis NOT the way to do it.Another possible solution would be to implement a new feature for "ephemeral" or "hidden" properties - that disappear when saved.
If deleting the property yourself after saving is too difficult, please open a feature request :)