'Access Value Returning from Query in Nodejs

I have written a query as follows:

connection.query("SELECT COUNT(*) as count FROM raw_data WHERE trd_no = ? LIMIT 1", [bid_no], function(err, rows) {
        console.log('rows==',rows);
});

In console I am getting:

rows== [ RowDataPacket { count: 0 } ]

Now I want to access the count value that is '0', I have tried with array object but not getting. I need help in this.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source