title: Node.js MySQL updating records
body: <p>I am capturing data from an API, putting it in an array <strong><em>([arr1])</em></strong> and using node-mysql to query my DB and insert data to it.</p>
  
  <p>This is <strong>working fine</strong> when pushing new records, as per the below:</p>
  
  <pre><code>    var arr1 = response.data.map(function(item) {
      return [item.employeeDetails.id, item.employeeDetails.personalDetails.firstName, item.employeeDetails.personalDetails.lastName, item.employeeDetails.personalDetails.emailAddress];
  });
  
  var query = connection.query('INSERT IGNORE INTO employees(pk_userId, firstName, lastName, emailAddress) VALUES ?', [arr1],
      function(error, results, fields) {
          if (error) console.log(error);
          else {
              console.log("Imported=");
          }
      });
  </code></pre>
  
  <p>I am trying to add a second query, to update changed records. I have been reading tutorials and docs, however am still having issues. The following is what I am trying after following instructions online:</p>
  
  <pre><code>var query2 = connection.query('UPDATE employees SET ? WHERE ?', [arr1],
      function(err, rows) {
          if (err)
              console.log("Error Updating ", err);
      });
  </code></pre>
  
  <p>So, I am using the same <strong>[arr1]</strong> array that I got from the API, however I am a bit lost on how to tell MySQL to look for records to update.</p>
  
  <p>Any advise or direction would be much appreciated. </p>