MongoDB ODM: Atomic Operator Improvements
Posted on
Recently we've improved the support for use of atomic operators and how much it takes advantage of them in the Doctrine MongoDB ODM. Now when updating embedded documents it will use dot annotation to $set
the individual properties instead of sending the entire document even if only one property changes.
Here is an example, first insert some new data:
Now if we make some changes and flush()
again it will perform an update:
The above will result in the following queries, first it must run a $set
to modify existing embedded documents:
Then it issues another update to $pushAll
the new phonenumbers: