Remove entire column in all documents in mongodb

The syntax of remove Address column out of all User document
upsert: false value which does not insert a new document when no match is found.
multi: true, updates multiple documents that meet the query criteria. If set to false, updates one document.


db.getCollection('User').update({},
{ $unset: {'Address': 1}},
false,
true)

Posted by justinpham

Leave a Reply