0
I’m starting in Node.js running Function and would like to know how to return a db field and move to a variable, I usually use a callback, for example:
Conect.query('select nome from pessoa where id=1', function(erros, data){
Console.log(data)
}
But I would like to return in an external variable that date for example:
Var banco = Conect.query('select nome from pessoa whre id=1')
But when I do this it returns parameters of the connection and the query being executed, I can return the value of this field in a Promisse suddenly or something like?