mongodb如何筛选不等于空的字段

mongodb筛选不等于空的字段的方法:

在mongodb数据库中表示非空的方法有(not null)和($ne:null)两种方法

使用“find{{字段:{$ne:null}}}”方法就可以筛选非空的字段了

示例如下:

db.getCollection("xttblog").find({type:{$ne:null}})
db.getCollection("xttblog").find({type:{not null}})

更多Python知识,请关注:天天编程python教程网!!

来源:PY学习网:原文地址:https://www.py.cn/article.html

来源:PY学习网:原文地址:https://www.py.cn/article.html