MongoDB exists 查询
扫码查看 原文链接 : https://blog.lmlphp.com/tutorial/4/mongodb/item/4/MongoDB_fields_exists_query_commands 来自 : LMLPHP后院
查询字段是否存在,条件为 null 时会包含字段不存在的文档数据,为了过滤字段存在的文档,使用 $exists。示例:
> db.collection_name.find({"name":{$in:[null], $exists:true}})