查找存在于集合中且具有非空值或非空值的所有属性

Find all properties which exists in collection and has not-null or not empty value

我正在尝试在我的集合中使用 Robo3T 查找所有属性 属性 InternalCode 不为空且不为空

db.getCollection('db1.customer').find({ InternalCode : { $exists: true, $ne: null } })

这将 return 所有具有 属性 且设置为不为空的文档。

How to deal with scenarios where I want nonempty and not null value?

不为空不为空,

db.getCollection('db1.customer').find({ InternalCode : { $exists: true, $nin:[null,""] } })