I have a problem in KnexJs I'm using with postgreSQL, but every time I make a select the knex answers all the data in the table as a string, which is not the case, since there are fields that are numbers and the knex Pass me like string someone would know how to help me I'm desperate.
Select knex
function getDeadlines(){
let query = knex(prazo.getTableName())
.select(prazo.properties.idDeadline.getDbProperty(), prazo.properties.deadline.getDbProperty())
.orderBy(prazo.properties.deadline.getDbProperty(), 'desc')
return query
}
Response knexjs code
{
deadlines: [
{
cd_prazo_pk_36: "1", //(Is a numeric in database table)
ds_prazo_36: "A Vista"
},
{
cd_prazo_pk_36: "2", //(Is a numeric in database table)
ds_prazo_36: "7 Dias"
},
{
cd_prazo_pk_36: "4", //(Is a numeric in database table)
ds_prazo_36: "21 Dias"
},
{
cd_prazo_pk_36: "3", //(Is a numeric in database table)
ds_prazo_36: "14 Dias"
}
]
}
cd_prazo_pk_36 it's not a string, it's a numeric
Connection
development: {
client: 'pg',
connection: {
host : 'localhost',
user : 'postgres',
password : '123',
database : 'testing',
charset: 'utf8'
},
useNullAsDefault: true
},
I already thank you