2013-12-18 50 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庫。

相關問題