-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Description
Issue type:
[x] question
[ ] bug report
[ ] feature request
[ ] documentation issue
Database system/driver:
[ ] cordova
[ ] mongodb
[ ] mssql
[ ] mysql
/ mariadb
[ ] oracle
[x] postgres
[ ] cockroachdb
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo
TypeORM version:
[x] latest
[ ] @next
[ ] 0.x.x
(or put your version here)
Steps to reproduce or a small repository showing the problem:
Apologies for opening an issue for this, it seems like I am probably missing something very obvious but essentially the issue is that soft-deleted entities are being returned as part of relations.
Example:
Say we have "User" and "Post" - user has many posts
const userWithPosts = await userRepo.findOne(1, { relations: [ 'posts' ] })
userWithPosts.posts
will contain all posts, even ones that have been deleted
Am I missing something obvious here? This functionality works as expected when not using relations (e.g. in the above example, postRepo.find()
would only return non-deleted items) but when using relations I am running into this issue.