I am trying to update a data inside the MongoDB database . I am using findByIdAndUpdate function to do this , but a duplicate data gets inserted into the database .
findByIdAndUpdate