title: Mongodb .post unable to add data to the collection
body: <p><strong>I am trying to take user input and then add a drug(medicine) to MongoDB. But it is not working and I am getting the error &quot;Add proper parameter first&quot;. The user input should be patient name, drug name, dosage, frequency, adherence, and reason for not taking medicine. Please help!</strong></p>
  <pre><code>app.post(&quot;/add-drug&quot;, (req, res) =&gt; {
    try {
      if (req.body &amp;&amp; req.body.patient_name &amp;&amp; req.body.drug_name &amp;&amp; req.body.dosage &amp;&amp; req.body.frequency &amp;&amp; req.body.adherence &amp;&amp; req.body.reason) {
        let new_drug = new drug();
        new_drug.patient_name = req.body.patient_name
        new_drug.drug_name = req.body.drug_name;
        new_drug.dosage = req.body.dosage;
        new_drug.frequency = req.body.frequency;
        new_drug.adherence = req.body.adherence;
        new_drug.reason = req.body.reason;
        new_drug.user_id = req.user.id;
  
        new_drug.save((err, data) =&gt; {
          if (err) {
            res.status(400).json({
              errorMessage: err,
              status: false
            });
          } else {
            res.status(200).json({
              status: true,
              title: 'Drug Added successfully.'
            });
          }
        });
  
      } else {
        res.status(400).json({
          errorMessage: 'Add proper parameter first!',
          status: false
        });
      }
    } catch (e) {
      res.status(400).json({
        errorMessage: 'Something went wrong!',
        status: false
      });
    }
  });
  </code></pre>
  <p><strong>The model file looks like this:</strong></p>
  <pre><code>
  var mongoose = require('mongoose');
  var Schema = mongoose.Schema;
  
  drugSchema = new Schema( {
      patient_name: String,
      drug_name: String,
      dosage: Number,
      frequency: Number,
      adherence: Number,
      reason: String,
      user_id: Schema.ObjectId,
      
  }),
  drug = mongoose.model('drug', drugSchema);
  
  module.exports = drug;
  
  </code></pre>