mongodb update all documents with field code example
Example: mongo change all documents on field
//Update all documents with "oldName" to "newName"
db.names.updateMany({ "name": "oldName" }, { $set: { "name" : "newName" } })
//Update all documents with "oldName" to "newName"
db.names.updateMany({ "name": "oldName" }, { $set: { "name" : "newName" } })