title: How to get data from database in array format using node js and MySql
body: <p>I am using node.js as server language and Mysql as database so I am running query and getting data from database but is is showing in format like this </p>
  
  <pre><code>  [ BinaryRow { name: 'Dheeraj', amount: '77.0000' },
      BinaryRow { name: 'Raju', amount: '255.0000' } ]
  </code></pre>
  
  <p>What I want is </p>
  
  <pre><code>    ['Dheeraj', 77.0000],
      ['Raju', 66255.000030],
  </code></pre>
  
  <p>This what I am doing in my backend (node.js):</p>
  
  <p>My model:</p>
  
  <pre><code>static getChartData(phoneNo, userType) {
  
          let sql = 'select businessname as name,sum(billamt) amount from cashbackdispdets where consphoneno =' + phoneNo + ' group by  businessid order by tstime desc limit 10'
          return db.execute(sql, [phoneNo]);
  </code></pre>
  
  <p>My controller:</p>
  
  <pre><code>exports.getColumnChart = function(req, res) {
      const phoneNo = req.body.userId
      const userType = req.body.userType
      console.log(phoneNo)
      dashboardModule.getChartData(phoneNo, userType)
          .then(([rows]) =&gt; {
              if (rows.length &gt; 0) {
                  console.log(rows)
                  return res.json(rows)
              } else {
                  console.log("error")
                  return res.status(404).json({ error: 'Phone No. already taken' })
              }
          })
      .catch((error) =&gt; {
          console.log(error)
          return res.status(404).json({ error: 'Something went wrong !!' })
      })
  }
  </code></pre>
  
  <p>I am sending this data to <code>Ui</code> and when I am receiving it on <code>UI</code>  it is in the form of object inside array which is not the required data type I want</p>
  
  <pre><code>axios().post('/api/v1/Dashboard/DashboardColumnChart',this.form)
    .then(res=&gt;{
      console.log(res.data)
      debugger
    this.chartData= res.data
         })
  </code></pre>
  
  <p>The above code consoles on browser like <a href="https://i.stack.imgur.com/XzIzW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XzIzW.png" alt="this"></a></p>
  
  <p>I am not getting any idea how o do it should I do it with backend or with front end and how</p>