Skip to content
New issue

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

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

Already on GitHub? # to your account

Partial updates and typed documents #91

Open
alexkirsz opened this issue Jan 24, 2022 · 0 comments
Open

Partial updates and typed documents #91

alexkirsz opened this issue Jan 24, 2022 · 0 comments

Comments

@alexkirsz
Copy link

Hey! Thanks for building this crate :)

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:

  1. the compiler won't complain if there are doc! calls that still refer to this field.
  2. rust-analyzer won't be able to refactor it automatically.

(2) is less of a concern, but (1) seems problematic.

Cheers,
Alex

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant