Answers for "mongodb update set new fieldmany"

2

update field name in mongodb

// false,true is set for =>{upsert:false, multi:true}
db.foo.update({}, {$rename:{"name.additional":"name.last"}}, false, true);
Posted by: Guest on August-11-2021
-1

mongo change all documents on field

//Update all documents with "oldName" to "newName"
db.names.updateMany({ "name": "oldName" }, {  $set: { "name" : "newName" }  })
Posted by: Guest on June-01-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language