try using
//make sure you import Course moduleCourse.findByIdAndUpdate(id).then(response=>{}).catch(err=>{})
I just had to re-import the collection without _id so it can regenerate them