mongodb delete where a field is not exist 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 } }
]
})