codeIgniter mongoDB delete document not work with id -


this not working:

function delmodel() {    $this->mongo_db->where->(array('_id'=>'5195b4293f8f31362a4f2093'))->delete('links'); } 

this working:

function delmodel() {     $this->mongo_db->where->(array('url'=>'www.google.com'))->delete('links'); } 

i working codeigniter mongodb , i'm totaly baffled output.

try following

function delmodel() {    $id = new mongoid('5195b4293f8f31362a4f2093');    $this->mongo_db->where->(array('_id'=> $id))->delete('links'); } 

Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -