Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.0] Fix upsert handling of nullable fields #1767

Merged
merged 3 commits into from
Mar 31, 2018

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Mar 31, 2018

Cherry-pick from #1764 for 2.0.

@alcaeus alcaeus added the Bug label Mar 31, 2018
@alcaeus alcaeus self-assigned this Mar 31, 2018
@alcaeus alcaeus requested a review from malarzm March 31, 2018 12:07
Cherry-pick from f04d413

This brings consistency to the upsert handling of fields with a null values. Non-nullable fields were not unset from the database to prevent loss of data, but nullable fields had their null value set in the daatabase. Since the object being upserted may be an incomplete object that doesn't completely represent the database state, we only write null values to the database if the upsert results in a document insertion.
@alcaeus alcaeus force-pushed the fix-upsert-nullable-fields-2.0 branch from 998ea8b to bfc9c7e Compare March 31, 2018 12:28
@alcaeus alcaeus force-pushed the fix-upsert-nullable-fields-2.0 branch from bfc9c7e to 03c0133 Compare March 31, 2018 12:52
@alcaeus alcaeus merged commit 98f89f1 into doctrine:master Mar 31, 2018
@alcaeus alcaeus deleted the fix-upsert-nullable-fields-2.0 branch March 31, 2018 13:14
malarzm added a commit to malarzm/mongodb-odm that referenced this pull request Apr 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants