MongoDB/PyMongo: Querying multiple criteria - unexpected results

前端 未结 2 781
离开以前
离开以前 2020-12-31 13:28

I have a collection where some of the objects feature an key foo. I now try to query for all objects that indeed have this key but not with the specific value <

2条回答
  •  有刺的猬
    2020-12-31 14:17

    No necessary to use $and, it also works

    db.collection.find({"foo":{"$ne":"bar", "$exists":true}})
    

提交回复
热议问题