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
Are there any plans for enabling partial updates with Model::save? As I understand it, right now, calling save will send the whole document to the database instead of only the fields that were changed.
While this can already be done today using Model::update, this involves giving up type-safety, as update accepts a Document which knows nothing of the underlying model. My main concern is with typos and refactoring: if I rename or delete a field in the underlying schema:
the compiler won't complain if there are doc! calls that still refer to this field.
rust-analyzer won't be able to refactor it automatically.
(2) is less of a concern, but (1) seems problematic.
Cheers,
Alex
The text was updated successfully, but these errors were encountered:
Hey! Thanks for building this crate :)
Are there any plans for enabling partial updates with
Model::save
? As I understand it, right now, callingsave
will send the whole document to the database instead of only the fields that were changed.While this can already be done today using
Model::update
, this involves giving up type-safety, asupdate
accepts aDocument
which knows nothing of the underlying model. My main concern is with typos and refactoring: if I rename or delete a field in the underlying schema:doc!
calls that still refer to this field.(2) is less of a concern, but (1) seems problematic.
Cheers,
Alex
The text was updated successfully, but these errors were encountered: