I am a MongoDB newbie and the examples I am seeing is using other fields as a filter but I want to update using the ObjectId
How do you update by ObjectId in mongosh?
I tried
db.devices.updateOne({"_id": ObjectId("6427f848b39a9135e7b7e63e")}, {"$set" :{"value": "on"}})
but no rows were updated.
What should be the correct query in this case?