when using the update statement via PHP means am getting the error.
Call to undefined method MongoDB::update()
I'm using the mongo-php-driver driver for connecting the MongoDB and PHP
My Code
$result = $this->mongo_db->update('table_name',array('user_type'=>"D"),array('$set'=>array('account_balance'=>0)),array('upsert'=>true));
My MongoDB reference link is https://docs.mongodb.com/manual/reference/method/db.collection.update/
Hi am using updateMany instead of update. Its working fine for me.
$result = $this->mongo_db->updateMany('table_name',array('user_type'=>"D"),array('$set'=>array('account_balance'=>0)),array('upsert'=>true));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With