How do you query for “is not null” in Mongo?

后端 未结 10 2171
暖寄归人
暖寄归人 2020-11-30 15:59

I would like to execute a following query:

db.mycollection.find(HAS IMAGE URL)

What should be the correct syntax?

10条回答
  •  有刺的猬
    2020-11-30 16:49

    The simplest way to check the existence of the column in mongo compass is :

    { 'column_name': { $exists: true } }
    

提交回复
热议问题