xxxxxxxxxx
db.mycoll.updateMany({}, { $unset: { myDefunctProperty: "" }})
xxxxxxxxxx
//--- Delete all attributes which contain id ---//
db.products.update({}, {$unset: {id: true}}, {multi:true} )
//--- Delete all attributes which contain description ---//
db.products.update({}, {$unset: {description: true}}, {multi:true} )
xxxxxxxxxx
=> Use the $unset field update operator to completely remove a field from a document.
{ $unset: { "field_name": "value" } }
=> You can specify multiple fields to remove by separating them with a comma.
{ $unset: { name: "", weight: "" } }