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
Is your feature request related to a problem? Please describe.
When saving an update to a model, the entire document is overwritten in the database, as opposed to only the fields that have changed, which could open you up to concurrency issues. Tracking changes can also be useful when implementing something like audit log.
Describe the solution you'd like
An update that only $sets the changed fields and a function API (e.g. model.HasChanged("FieldName")) to check what fields have changed in the hooks.
Describe alternatives you've considered
I'm not sure how this could implemented without changes to mgm, but open to ideas for sure!
Additional context
Would you all be open to a PR to add this if I put some work into it?
The text was updated successfully, but these errors were encountered:
Hi @bencrouse
Tracking changes in models could be a little be complicated.
I think the more simple solution for concurrency issues could be MongoDB transactions and optimistic locks which will be added after merging PR #56
Is your feature request related to a problem? Please describe.
When saving an update to a model, the entire document is overwritten in the database, as opposed to only the fields that have changed, which could open you up to concurrency issues. Tracking changes can also be useful when implementing something like audit log.
Describe the solution you'd like
An update that only
$set
s the changed fields and a function API (e.g.model.HasChanged("FieldName")
) to check what fields have changed in the hooks.Describe alternatives you've considered
I'm not sure how this could implemented without changes to
mgm
, but open to ideas for sure!Additional context
Would you all be open to a PR to add this if I put some work into it?
The text was updated successfully, but these errors were encountered: