I try to delete document in mongodb using php, I it fails and I get a waring:
Warning: MongoCollection::remove() expects parameter 2 to be boolean, array given
$mongo = new Mongo();
$db = $mongo->test;
$collection = $db->subscribers;
$collection->remove(array( 'LISTID' => 49));
Could you please tell me what causes an error?
I phpinfo() shows:
mongo
MongoDB Support enabled
Version 1.0.4+
Directive Local Value Master Value
mongo.allow_persistent On On
mongo.auto_reconnect On On
mongo.chunk_size 262144 262144
mongo.cmd $ $
mongo.default_host localhost localhost
mongo.default_port 27017 27017
mongo.utf8 1 1
It’s strange, the documentation say the function looks like:
public mixed MongoCollection::remove ( array $criteria [, array $options = array() ] )
You appear to be using a very old version. From the manual
Either upgrade or change your code to