doctrine / mongodb-odm

The Official PHP MongoDB ORM/ODM
https://www.doctrine-project.org/projects/doctrine-mongodb-odm/en/latest/
MIT License
1.09k stars 502 forks source link

Change default collection startegy to atomicSetArray #1239

Open malarzm opened 8 years ago

malarzm commented 8 years ago

This was raised by @blockjon and @daniphp (https://github.com/doctrine/mongodb-odm/pull/1096#issuecomment-143741431) - I agree that this could be done, atomicSetArray was chosen to keep collections as list by default HOWEVER this is a BC break as deeply nested addToSet are no longer working as expected and also upserts can be hurt.

@jmikola @jwage @alcaeus thoughts?

alcaeus commented 6 years ago

Pushing this back to 2.x - with the new filtered positional operator we are now able to create atomic collection updates not only on the root level but also in nested arrays. I'd say we should wait until this is implemented before changing the default strategy.