How about something like this:
db.stackoverflow.find({
$or: [
{ howmuch: { $exists:false } },
{ howmuch:5 }
]})
In the stackoverflow collection, all documents that do not have a field howmuchplus all documents that are howmuchset to 5 will be found .
source
share