I have an Email
document which has a sent_at
date field:
{
'sent_at': Date( 1336776254000 )
}
If this Email
has not been sent, the sent_at
field is either null, or non-existant.
I need to get the count of all sent/unsent Emails
. I'm stuck at trying to figure out the right way to query for this information. I think this is the right way to get the sent count:
db.emails.count({sent_at: {$ne: null}})
But how should I get the count of the ones that aren't sent?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…