mongodb delete if field is something code example
Example: mongodb delete document where field exists
db.users.remove({
"$or": [
{ "firstName": { "$exists": false } },
{ "lastName": { "$exists": false } }
]
})
db.users.remove({
"$or": [
{ "firstName": { "$exists": false } },
{ "lastName": { "$exists": false } }
]
})