我想写一个select * from job where updateTime<>0 and updateTime is not null
正常情况下mongodbl的find()中所有的条件是and,但是以下写法查询出来的结果却是or
db.Job.find({ 'updateTime': {$exists: true},'updateTime': {$ne:0} })
改写后:
db.Job.find({
$and:[{updateTime: {$exists: true}},{updateTime: { $ne : 0 }}]
})
才实现and