doctrine/mongodb-odm — pull request #404 by tlync (2012-09-09 15:05:46+00:00)
Title: Fix wrong $set behavior with embed many collections

EmbedMany with set strategy behavior seem wrong.
Maybe the problem is CollectionPersister is always persist as associative array.

For example, I define two document classes below.
```php
/** @ODM\Document */
class Parent
{
/** @ODM\Id */
private $id;

/** @ODM\EmbedMany(targetDocument="Child", strategy="set") */
private $childs;

...
}

/** @ODM\EmbeddedDocument */
class Child
{
/** @ODM\String */
private $value

...
}
```

Then, when these classes are persist by CollectionPersister.
I expect that query is like this.
```
{ $set : { childs: [{'value': 'foo'}, {'value': 'bar'}] } }
```

However, the query I got is as below.
```
{ $set : { 'childs.1.value' : 'foo', 'childs.2.value': 'bar' } }
```

It might be wrong.
So I fixed this.

See also: #341