Q: Mysql find element I have:
const connection = mysql.createConnection({
   host: process.env.APP_DATABASE_HOST,
   user: process.env.APP_DATABASE_USER,
   password: process.env.APP_DATABASE_PASS,
   database: process.env.APP_DATABASE_NAME,
   port: process.env.APP_DATABASE_PORT
});

const connectDataBase = () => {
    connection.connect(function(error){
        if(error){
           console.log(error);
        }else{            
           console.log('Connected');
        }
     });
}

exports.search = async (id) => {  
    try {
       connectDataBase(); 
       await connection.query(`SELECT * from devices where numberserial="${id}"`, function (err, result, fields) {
          if( result ){
             return true;
          }
          return false;
        });     
       closeConnectionDataBase();
    } catch (error) {
       console.log(error)
    }
 };

const closeConnectionDataBase = () => {
   connection.end();
}

I want that when it gets the element it returns true, but if it doesn't get the element it returns false.
for now if it gets the element it returns true, the problem I'm having is when it doesn't get the element the terminal gets stuck, what am I doing wrong??? what I want is that if the element is not found in the database it returns false
