目前我正在使用ichikaway cake-php MongoDB插件将我的CakePHP与MongoDB连接,我在执行find方法时遇到问题,下面是我的代码。
debug($this->Keyword->find("all",array(
"conditions" => array("Keyword.keyword LIKE"=>"%p%")
)));
即使我在DB中有数据,我也得到一个空的响应 有什么我想念的吗? 提前致谢
我认为应该是
$this->Keyword->find('all')
->where(function($event){return $event->or_([
'Keyword.keyword LIKE '=>'%'.$this->request->query('search_item').'%', // if search_item comes through GET method
]);
});