title: Nodejs TypeError cannot read property 'join' of undefined req.body
body: <p>I just want to know why this is not working! It shows me this error: "TypeError cannot read property 'join' of undefined" while I'm trying to store some data from the req.body into my database(table: analyses) using knex and postgeSQL. This is my createanalyses.js file:</p>
  
  <pre><code>const handleCreate = (req, res, db) =&gt; {
  console.log(req.body);
  const g='{"' + req.body.detaillalb.join('","') + '"}';
  const d='{"' + req.body.globallab.join('","') + '"}';
  db('analyses').insert({
      userid: req.body.id,
      choice: req.body.choice,
      globallabel: g ,
      detaillabel: d,
      globalresults: req.body.globalresp,
      detailresults: req.body.detailresp,
      description: req.body.description
  }).then(data =&gt; console.log(data))
  .catch(err =&gt; res.status(400).json('Erreur : Probleme dataAnalyse'));
  return null
  </code></pre>
  
  <p>}</p>
  
  <p>On server.js I have: </p>
  
  <pre><code>   app.post('/createanalysis', (req,res) =&gt; {
      createanalysis.handleCreate(req,res,db);
  })
  </code></pre>
  
  <p>And my 'analyses' table looks like this:</p>
  
  <pre><code>analyses (
  id serial primary key,
  userid integer not null,
  choice varchar(25) not null,
  globallabel text ARRAY,
  detaillabel text ARRAY,
  globalresults integer ARRAY,    
  detailresults integer ARRAY,
  description varchar(200),
  FOREIGN KEY (userID) REFERENCES users (id)
  </code></pre>
  
  <p>);</p>
  
  <p>console.log(req.body) shows that there is data in detaillab and globallab.
  Please help me resolve this!</p>