You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 11, 2021. It is now read-only.
Now if I create a new user or get a existing user from MongoDB and change something inside the DocumentSet and call save() directly on the DocumentSet every thing get saved. BUT after saving the DocumentSet (or the Document as DocumentSet does not overwrite save()) it recieves the new values directly from MongoDB and sets the _cleanData field with these values. But MongoDB returns the complete document and not only the changed part of the document, so _cleanData in the DocumentSet contains the complete Document.
There is a big issue with calling save() on a DocumentSet (probably it is a problem with all embeded Documents).
Consider following model:
Now if I create a new user or get a existing user from MongoDB and change something inside the DocumentSet and call save() directly on the DocumentSet every thing get saved. BUT after saving the DocumentSet (or the Document as DocumentSet does not overwrite save()) it recieves the new values directly from MongoDB and sets the _cleanData field with these values. But MongoDB returns the complete document and not only the changed part of the document, so _cleanData in the DocumentSet contains the complete Document.
See below example:
$user->addresses->_cleanData before save:
$user->addresses->_cleanData after save:
This makes working with the saved DocumentSet impossible.
The save method needs to check which part of the document is saved and retrieve the right part of the document to write to _cleanData
There are two workarounds for this problem at this time:
I really hope you can fix this soon.
Thanks in advance!
Best regards,
Fender
The text was updated successfully, but these errors were encountered: