title: how can I drop my collection in mongoDB using mongoose?
body: <p>I have connected with MongoDB using below code.</p>
  
  <pre><code>mongoose.connect('mongodb://localhost:27017/samplecustomfields')
  .then(() =&gt; console.log('MongoDB Connected...'))
  .catch(err =&gt; console.log(err));
  </code></pre>
  
  <p>I have created the schema model and load model in my app.js file. You can see below code</p>
  
  <pre><code>const customfields = [
  {
    'id': 104,
    'name': '[Sample] Utility Caddy',
    'customfields': [
        {
            'id': 7,
            'product_id': 104,
            'name': 'Sample Utility',
            'text': 'canddy ofsuc'
        }
   }
  ]
  require('./models/customfieldlists');
  const productfields = mongoose.model('fields');
  
  app.get('/api/products', (req, res, next) =&gt; {
  productfields.insertMany(customfields, function(error, docs) {
    console.log('done');
  });
  res.send(customfields);
  });
  </code></pre>
  
  <p>How can I drop my "fields" collection first and after call "insertMany" query. This should happend everytime when I get the '/api/products' this request.</p>
  
  <p>I have put the code "productfields.dropCollection('fields');" above insertMany query but it does not work. </p>