I have an Email document which has a sent_at date field:
Email
sent_at
{ \'sent_at\': Date( 1336776254000 ) }
If this E
E
Use:
db.emails.count({sent_at: null})
Which counts all emails whose sent_at property is null or is not set. The above query is same as below.
db.emails.count($or: [ {sent_at: {$exists: false}}, {sent_at: null} ])