我正在使用Codeigniter和MongoDb library。
我想执行一个字段存在的选择。
db.yourcollection.find({ 'otherInfo.text' : { '$exists' : true }})
但是我找不到如何使用这个库...
有任何解决方案吗?
答案 0 :(得分:4)
这里不是CI程序员,但我想:
$this->mongo_db->where(array('otherInfo.text'=>array('$exists'=>true)))
会起作用。