mongodb remove field from document code example
Example 1: remove property mongodb
db.myCollection.update({}, {$unset: {fieldToRemove:1}} , {multi: true});
Example 2: mongodb delete document where field exists
db.users.remove({
"$or": [
{ "firstName": { "$exists": false } },
{ "lastName": { "$exists": false } }
]
})