[MODM-85] Saving a array over the top of a PersistentCollection results in duplicated data Created: 08/Oct/10  Updated: 24/Nov/10  Resolved: 24/Nov/10

Status: Resolved
Project: Doctrine MongoDB ODM
Component/s: None
Affects Version/s: None
Fix Version/s: 1.0.0BETA2

Type: Bug Priority: Critical
Reporter: Andy Stanberry Assignee: Jonathan H. Wage
Resolution: Fixed Votes: 0
Labels: None

Mongo 1.6.1, opensky/mongo-odm/master


If you take an document that has a referenceMany and overwrite a PersistentCollection of data with an array, even of the same data, the data is appended to the collection instead of replacing it.

Comment by Sebastian Hoitz [ 12/Oct/10 ]

Are you using the most recent version of Doctrine MongoDB ODM?

I'm asking because there was a bug fix for something where all embedded documents were duplicated.

However I'm also currently investigating a bug where in some cases only one entry does not get removed (although $pullAll is called correctly).

Comment by Jonathan H. Wage [ 19/Oct/10 ]

Bulat, this is the same issue where PersistentCollection is never initialized so thats why the array_diff always appends the data with a $pushAll. Remember we talked about it? we can fix it just need to chat about it for a bit.

Comment by Jonathan H. Wage [ 24/Nov/10 ]

This is not a problem anymore after the recent refactoring!

Generated at Tue Dec 01 15:22:23 EST 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.