Get a Quote Right Now

Edit Template

Partial selection

If you want to select only some entity properties, you can use the following syntax:

const users = await dataSource
    .getRepository(User)
    .createQueryBuilder("user")
    .select(["user.id", "user.name"])
    .getMany()

Share

Leave a Reply

Your email address will not be published. Required fields are marked *