Hi, I'm using mongodb to store some data and is working fine, but I don't know how to remove documents, I'm doing:
$collection = mongodb_collection("mycollection");
$collection->remove(array('_id' => $id));
Where $id would be the mongodb id, something like "4f937d5f74b25e8d4f000000".
But this is not working. Can someone please point me in the right direction?
Thanks in advance
Comments
Comment #1
lelizondo commentedI found that something like this will work:
$collection->remove(array('_id' => new MongoId($id)), true);Comment #2
misc commentedThis is not related to the Mongodb module, so I am closing this one.
Comment #3
lelizondo commentedYes it was related to the Mongo db module because I'm using the module and I needed help.
Anyway, I already solve it and I forgot to mark it as fixed.