Open
Description
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?
Metadata
Assignees
Labels
No labels
Activity