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

后端 未结 10 2304
暖寄归人
暖寄归人 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:56

    the Query Will be

    db.mycollection.find({"IMAGE URL":{"$exists":"true"}})
    

    it will return all documents having "IMAGE URL" as a key ...........

提交回复
热议问题