title: Having issue in updating the data in Node js
body: <pre><code>router.put('/edit:/id',(req,res)=&gt;{
  
  
  Post.findOne({_id: req.params.id}).then(post=&gt;{
      if(req.body.allowComments)
           {
              allowComments = true;
           }
          else
              {
                  allowComments = false;
              }
  
          post.title = req.body.title;
          post.status = req.body.status;
          post.allowComments = allowComments;
          post.body= req.body.body;
  
  
  
          post.save().then(updatedPost=&gt;
          {
              res.redirect('/admin/posts');
  
          });
  
  });
  
  
  });
  </code></pre>
  
  <p>Showing error don't know why please help
  I want to update the record or make changes to the previous data.
  I'm using nodejs deletion and all are working fine but updation are creating issue</p>