title: .findByIdAndRemove is not a function
body: <p>Consider the following code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>app.delete('/customer/:id',(req,res) =&gt;{
      
      var idRemove = String(req.params.id);
      console.log(idRemove);//this part is working 
      var user = new Customers(req.body);
               console.log(user)//this part is working 
  
              user.findByIdAndRemove({id :idRemove},(err, doc) =&gt; {
                  if (!err)
                      res.status(200).send(doc);
                  else {
                      res.status(500).send(err)
  //showing error here telling me that user.findByIdAndRemove is not a function
                  }
  
              })
  
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>I am receiving an error that says ".findByIdAndRemove is not a function."</p>
  
  <p>How can I prevent this error?</p>