title: insert multiple rows into mysql through node.js
body: <p>I want to insert multiple rows into mysql thru node.js mysql module. The data I have is </p>
  
  <pre><code>var data = [{'test':'test1'},{'test':'test2'}];
  </code></pre>
  
  <p>I am using pool</p>
  
  <pre><code> pool.getConnection(function(err, connection) {
       connection.query('INSERT INTO '+TABLE+' SET ?', data,   function(err, result) {
            if (err) throw err;
              else {
                  console.log('successfully added to DB');
                  connection.release();
              }
        });
   });
  }
  </code></pre>
  
  <p>which fails.</p>
  
  <p>Is there a way for me to have a bulk insertion and call a function when all insertion finishes?</p>
  
  <p>Regards
  Hammer</p>