title: Insert json to mysql row in nodejs
body: <p>I'm currently developing a program that connects to various external APIs for transactions.</p>
  <p>The APIs returns a JSON that I want to store completely in a MySQL database column. I don't want to create a column for every data returned as that means I'll have to create different rows for every different JSON response, and that's not scalable.</p>
  <p>I also want to keep them stored as JSON as they would be easy to process in a query and in code. So in my database I have a table where I store the external transaction info and an <code>external_extra</code> column where I want to store the JSON Object.´</p>
  <h3>My code</h3>
  <pre><code>connection.acquire(function(err, con) {
          console.log('inserting: ' + [transactionId, externalReference,
                  externalTransactionStatus, externalExtra]);
          con.query('insert into external_transaction (transaction, external_reference, status,' +
              'external_extra) ' +
              'values (?,?,?,?)', [transactionId, externalReference,
              externalTransactionStatus, externalExtra],
              function(err, result) {
                  con.release();
                  if(err) console.log(err);
                  cb(result.insertId);
              });
  </code></pre>
  <p>Where <code>externalExtra</code> is the JSON received from the API. Running that code gives me an error as it uses the JSON to add more fields to the insert instead of inserting the json. Example: if the json has a structure like:</p>
  <pre><code>{ 
    type: 'internal_transaction',
    address: 'rDLwhx2M9YfbNfZWDq5opJMttQjh7xtvh5',
    sequence: 42,
    id: 98,
    specification: 'created with rrDL55JshyMtlIU sequence'
  }
  </code></pre>
  <p>I get the error: Error:</p>
  <blockquote>
  <p>ER_BAD_FIELD_ERROR: Unknown column 'type' in 'field list' as it takes 'type' as a column for the table.</p>
  </blockquote>
  <p>Any help on this would be appreciated.</p>