MongoDB和CodeIgniter:选择字段存在的位置 [英] MongoDB & CodeIgniter: Select where a field exists
本文介绍了MongoDB和CodeIgniter:选择字段存在的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Codeigniter和 MongoDb库。 / p>
我想在字段存在的地方执行选择。
db.yourcollection.find({'otherInfo.text':{'$ exists':true}})
但是我找不到使用该库的方法...
请问有解决方案吗?
解决方案
这里不是CI程序员,但我会认为:
$ this-> ; mongo_db-> where(array('otherInfo.text'=> array('$ exists'=> true)))
会工作。
I'm working with Codeigniter and the MongoDb library.
I would like to perform a select where a field exists.
db.yourcollection.find({ 'otherInfo.text' : { '$exists' : true }})
But I can't find how to do that with this library...
Any solutions please?
解决方案
Not a CI programmer here but I would think:
$this->mongo_db->where(array('otherInfo.text'=>array('$exists'=>true)))
would work.
这篇关于MongoDB和CodeIgniter:选择字段存在的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文