doctrine/mongodb — Issue #38: GridFS doUpdate adds unnecessary $set command when performing $pushAll
Author: Wedgybo
Created: 2012-01-06 05:38:22+00:00
State: open

I have a collection that stores a document using the @File data type. I also have a field for storing where that file is referenced using the @ReferenceMany(targetDocument="Tag").

The problem is that when it performs the update it will set the collection of references to be like this.

{ "$pushAll" : { "test" : [
{
"$ref" : "employees",
"$id" : ObjectId("4ed823ae05685aae4c00001c")
}
] }

The desired outcome is what would happen inside a collection with no File data type.

"test" : [
{
"$ref" : "employees",
"$id" : ObjectId("4ed823ae05685aae4c00001c")
}
]

I've fixed it by commenting out the part that enforces the set command and its doesn't appear to have had any side effects. I don't know enough about the other functions to make a call on how to fix it correctly however. I notice this could relate to bug #31 also.