I had this issue recently, the answer for me was that findOneAndUpdate(query, rule) is asynchronous, so you have to await or then
Eg. var savedObj = await MyObj.findOneAndUpdate(query, newobj)