title: How to parse the data from "rows" object in node.js,express.js,mysql2
body: <p>I m using the node,express,mysql2 packages .When i m using console.log(rows) ,it is giving me following output:</p>
  
  <pre><code>[{"userid": "test","password": "test"}]
  </code></pre>
  
  <p>And here is my Code :</p>
  
  <pre><code>var application_root = __dirname,
  express = require("express"),
  mysql = require('mysql2');
  path = require("path");
  var app = express();
  
  var connection = mysql.createConnection({
  host : 'localhost',
  user : 'root',
  password : '123',
  database: "bbsbec"
   });
  app.configure(function () {
  app.use(express.bodyParser());
  app.use(express.methodOverride());
  app.use(app.router);
  app.use(express.static(path.join(application_root, "public")));
  app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
  });
  
  connection.query('SELECT * from pass', function(err, rows) {
       res.json(rows);
       console.log(rows);
     });
  </code></pre>
  
  <p>I just want to know that how can  i parse this "rows" object so that i can retrive both userid and password . </p>