这不起作用:
function delmodel()
{
$this->mongo_db->where->(array('_id'=>'5195b4293f8f31362a4f2093'))->delete('links');
}
这是有效的:
function delmodel()
{
$this->mongo_db->where->(array('url'=>'www.google.com'))->delete('links');
}
我正在使用CodeIgniter MongoDB,我对输出感到困惑。
答案 0 :(得分:2)
尝试以下
function delmodel()
{
$id = new MongoId('5195b4293f8f31362a4f2093');
$this->mongo_db->where->(array('_id'=> $id))->delete('links');
}