Open lakmal05 opened 3 weeks ago
if you are using Repository
, you can pass the param "select" in find/findOne, for example:
// you can use with find, findOne, findOneOrFail
repository.find({
select: {
id: true,
role: {
id: true,
name: true,
}
},
relations: {
role: true,
},
where: {
id: In([1, 2, 3]),
}
});
and with QueryBuilder
manager.createQueryBuilder(User, 'user')
.select('user.id')
.addSelect('role.id')
.addSelect('role.name')
.innerJoin('user.role', 'role')
.where('user.id IN (:...ids)', { ids: [1, 2, 3] })
.getMany();
see https://typeorm.io/find-options, https://typeorm.io/select-query-builder, https://typeorm.io/select-query-builder#partial-selection
Issue description
Issue
Expected Behavior
there is no any mention about the spesific selection
Actual Behavior
there is no any mention about the spesific selection
Steps to reproduce
there is no any mention about the spesific selection
My Environment
Additional Context
No response
Relevant Database Driver(s)
Are you willing to resolve this issue by submitting a Pull Request?
Yes, I have the time, and I know how to start.