MongoDB: How to query for records where field is null or not set?

前端 未结 6 1944
鱼传尺愫
鱼传尺愫 2020-11-27 12:58

I have an Email document which has a sent_at date field:

{
  \'sent_at\': Date( 1336776254000 )
}

If this E

6条回答
  •  庸人自扰
    2020-11-27 13:51

    db.employe.find({ $and:[ {"dept":{ $exists:false }, "empno": { $in:[101,102] } } ] }).count();
    

提交回复
热议问题