fuel/core — Issue #669: Mongo_Db update
Author: milosdakic
Created: 2011-11-15 11:05:10+00:00
State: open

The following call to Mongo_Db

```php
$id = 'dev-'.date('m');
$data = array('$inc' => array('projects.overview' => 1));

$insert_id = $mongo->where(array('_id' => $id))->update('stats', $data, array("upsert" => true));
```
causes the following error
**Fuel\Core\Mongo_DbException [ Error ]: Update of data into MongoDB failed: not okForStorage**

The fix seems to be to alter the update method from:

```php
$options = array_merge($options, array('fsync' => true, 'multiple' => false));
$this->db->{$collection}->update($this->wheres, array('$set' => $data), $options);
$this->_clear();
return true;
```
to

```php
$options = array_merge($options, array('fsync' => true, 'multiple' => false));
$this->db->{$collection}->update($this->wheres, $data, $options);
$this->_clear();
return true;
```