title: Insert JSON into MySQL JSON column format using NodeJS
body: <p>I have a Mysql table with these settings :</p>
  
  <pre><code>    CREATE TABLE `WorkOrders` (
    `workorder_id` int(11) NOT NULL AUTO_INCREMENT,
    `intertype_id` int(11) NOT NULL,
    `equipment_id` int(11) NOT NULL,
    `reason_id` int(11) NOT NULL,
    `requester_id` int(11) NOT NULL,
    `workorder_creationdatetime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `phase_id` int(11) NOT NULL,
    `criticality_id` int(11) NOT NULL,
    `workorder_targetdate` date DEFAULT NULL,
    `workorder_enddatetime` datetime DEFAULT NULL,
    `workorder_content` json DEFAULT NULL,
    PRIMARY KEY (`workorder_id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
  </code></pre>
  
  <p>The column 'workorder_content' have a JSON datatype.</p>
  
  <p>Then I have an AngularJS + Bootstrap linked to the database using a NodeJS api.</p>
  
  <p>I am trying to insert data to my table using that script :</p>
  
  <pre><code>connection.acquire(function(err, con) {
        con.query('INSERT INTO WorkOrders SET ?', workorder.workorder.int, function(err, result) {
          con.release();
          console.log(err);
          if (err) {
            res.send({status: 1, message: 'WorkOrder creation failed'});
          } else {
            res.send({status: 0, message: 'WorkOrder created successfully'});
          }
        });
      });
  </code></pre>
  
  <p>And here is what workorder.workorder.int contains :</p>
  
  <pre><code>{ phase_id: 1,
    intertype_id: '14',
    reason_id: '1',
    equipment_id: '2',
    requester_id: '24',
    criticality_id: '29',
    workorder_content: 
     { adresse_client: 'sefsdf',
       type_machin: '1',
       type_truc: '8',
       truc_cocher: true,
       truc_radio: '11',
       date_debut: '12/07/2017' } }
  </code></pre>
  
  <p>The error I have in the NodeJS console is :
  { Error: UNKNOWN_CODE_PLEASE_REPORT: Invalid JSON text: "Invalid value." at position 1 in value (or column) '[object Object]'.</p>
  
  <p>Can you please help me ?</p>
  
  <p>Thank you.</p>