#查询activityPriceJson字段不为空包括不为null且不为空字符串的结果集
db.getCollection('goods_index').find({"activityPriceJson":{$nin:[null,""]}})
说明:$nin 类似于关系型数据库中的IN
其他:
1. $ne
$ne:表示not equals 就是不等于的意思
# 查询某字段不为null的数据
db.getCollection('goods_index').find({activityPriceJson: {$ne:null}})
# 查询字段等于null的数据
db.getCollection('goods_index').find({activityPriceJson: {$eq:null}})
2. $exists
$exists:表示是否存在。值为false表示不存在,值为true表示存在
# 查询某字段不为空的数据
db.getCollection('goods_index').find({activityPriceJson:{$exists:true}})
# /查