Add support for atomic updates #437

jgornick opened this Issue Oct 25, 2012 · 4 comments


None yet
5 participants

jgornick commented Oct 25, 2012

The ODM doesn't support a single document update for all fields and embedded documents. The current implementation will run different queries for updating a single document and it's embedded documents.

This would certainly help remove queries between the ODM and Mongo and also remove the need to implement rollback functionality if an embedded document fails to insert.

I've created a repository with some scenarios @

After speaking with @jwage and @jmikola, it would be nice to be able to specify an atomicUpdate option in the relationship annotation:

/** @ODM\EmbedMany(…, atomicUpdates=true) */

sokac commented Feb 14, 2014

@jgornick have you tried making a patch? If so, could you share problems while building it? How complex is it?
This feature is crucial for my project so I'll probably start working on patch soon. Do you mind if I take your tests and add them in a pull request?


jgornick commented Feb 14, 2014

@sokac I'm sorry, but I ended up leaving the company that was working on that project. We ended up moving to a hybrid MySQL/Mongo solution that took care of our needs. However, I still feel like this would be a very useful feature.

I have the same problem for my project, saving a document don't made atomic update. I have update of some field on the document, next update on relation EmbedMany of the document, and finally update that is made by the method preUpdate.

This can cause problem because the update on the document is not atomic.

jmikola added this to the 1.x milestone Apr 1, 2014

@malarzm malarzm modified the milestone: 1.0.0-BETA13, 1.x May 19, 2015

malarzm added the has PR label May 19, 2015


malarzm commented May 19, 2015

Closing thanks to #1096

malarzm closed this May 19, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment