2013-12-18 55 views
0

我是通过Codeigniter使用mongodb的新手。我已经注意到了MongoDB的一些活动记录是非常相似的SQL例如如何使用Codeigniter选择不同的mongodb数据库

$this->db->get('mytable'); 
$this->mongo_db->get('mytable'); 

但是我遇到了一个问题,即在不同不起作用:

$this->mongo_db->distinct('name'); 
$this->mongo_db->get('mytable'); 

一直在寻找周围这一点,但couldn找不到任何东西,有没有办法呢?

非常感谢

回答

0

您可以使用:

$this->mongo_db->distinct('collection', 'field_name'); 

它会帮助你找到收藏DISTICT值。 确保你已经安装了mongo_db库。

相关问题