title: How to read results returned by a query when using mysql in nodejs server?
body: <p>I have something like this:</p>
  
  <pre><code>      var sql = "SELECT EXISTS(SELECT * FROM files)";
  
        var query = db.query(sql, function(err, result) {
          console.log(result[0]);
        });
  </code></pre>
  
  <p>console.log returns:
  <code>RowDataPacket { 'EXISTS(SELECT * FROM files)': 1 }</code></p>
  
  <p>Looks like this is a key-value pair? how do i access the value in this case?</p>
  
  <p>I did come across this: <a href="https://stackoverflow.com/questions/31221980/how-to-access-a-rowdatapacket-object">How to access a RowDataPacket object</a>. but in my case since the property is a string I am not sure how to access it.</p>