I have the following code:
connection((db) => { db.collection(\'orders\') .updateOne( { \"_id\": req.body
I had this trouble too, I create a constant with _id from req.body
const {_id} = req.body //pass ID user await User.updateOne({_id},{$set:data}, (err)=>{ if(err) return res.status(200).json({ error: true, code: 115, message: "Erro to update user!" }) })