ichikaway/cakephp-mongodb — Issue #44: MongodbSource::update replace nested subdocuments
Author: dario1985
Created: 2012-03-02 12:37:03+00:00
State: open

I dont know if it is the correct behavior: in MongodbSource::setMongoUpdateOperator include entire subdocument in $set statement instead of update subdocument attributes.

So document:

```Javascript
{
'_id' : ObjectId(),
'Data' : { 'attribute1' : 1 , 'attribute2' : 2, 'MoreData' : {} }
}
```

after updating with { 'Data' : { 'attribute1' : 2 }} became :

```Javascript
{
'_id' : ObjectId(),
'Data' : { 'attribute1' : 2 }
}
```

while I expected:

```Javascript
{
'_id' : ObjectId(),
'Data' : { 'attribute1' : 2 , 'attribute2' : 2, 'MoreData' : {} }
}
```