Skip to content

Partial updates and typed documents #91

@alexkirsz

Description

@alexkirsz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions