How to select by ID , with different colum name in typeORM?

Viewed 15

How can I find a camp name as "campName" ( column name of PSQL table database ) using type ORM. Right now I am using plain SQL query like below one

SELECT 
          camp.name as "campName"
    FROM 
            campaigns camp  
    WHERE   
        camp.id = 13

but when I use findOne() function of type ORM , I am always getting camp name as "name" ( actual colum name )

typeorm fuction :

const user = await this.campRepository.findOne(
    { where:
        { id: 13 }
    }
);

I tried to use above function of type orm, I am getting all user data , for example : name: camp one ,

Is there a way to get it as

campName : camp one ?

EXAMPLE TABLE

: table camp

id name place
13 camp one LA
0 Answers
Related