diff --git a/classes/Model/Mongo.php b/classes/Model/Mongo.php index 57bfcb0..e1eac7d 100755 --- a/classes/Model/Mongo.php +++ b/classes/Model/Mongo.php @@ -109,7 +109,7 @@ public function save($validate = true) } try { - $this->_collection->save($obj, array('safe'=>true)); + $this->_collection->save($obj, array('w'=>true)); } catch (MongoException $e) { $this->_error = $e->getMessage(); @@ -181,4 +181,4 @@ public function collection() return $this->_collection; } -} \ No newline at end of file +} diff --git a/classes/Mongo/Connection.php b/classes/Mongo/Connection.php index 3a0edfc..f50c04a 100755 --- a/classes/Mongo/Connection.php +++ b/classes/Mongo/Connection.php @@ -31,7 +31,7 @@ public function __construct($config='default') // Set the DB Name $this->_db = $this->_config['database']; - $this->_conn = new Mongo('mongodb://'.$str); + $this->_conn = new MongoClient('mongodb://'.$str); } public static function instance($config='default') @@ -54,4 +54,4 @@ public function db() { return $this->_conn->{$this->_db}; } -} \ No newline at end of file +}