Skip to content

Docs on "save" do not mention associations #11787

Closed

Description

@jcalfee

Issue Description

What was unclear/insufficient/not covered in the documentation

This says "save" will save the "fields" .. If I query a parent and a bunch of child objects, update some child objects, then call save on the parent will all changes get persisted?

https://sequelize.org/master/class/lib/model.js~Model.html#instance-method-save

If possible: Provide some suggestion on how we can enhance the docs

It would be good to document this either way.

Is this issue dialect-specific?

  • No. This issue is relevant to Sequelize as a whole.
  • Yes. This issue only applies to the following dialect(s): XXX, YYY, ZZZ
  • I don't know.

Would you be willing to resolve this issue by submitting a Pull Request?

  • Yes, I have the time and I know how to start.
  • Yes, I have the time but I don't know how to start, I would need guidance.
  • No, I don't have the time, although I believe I could do it if I had the time...
  • No, I don't have the time and I wouldn't even know how to start.

Activity

  1. added
    docs
    on Jan 3, 2020
  2. added
    status: understood
    on Jan 3, 2020
  3. self-assigned this
    on Jan 3, 2020
  4. added
    status: wip
    and removed
    status: understood
    on Jan 3, 2020
  5. papb commented on Jan 6, 2020

    @papb
    Member

    I will update the docs soon. Thanks for pointing this out.

    For now, here is the answer: save() is not aware of associations, and will simply ignore any changes you make to some child (eager-loaded) object.

  6. removed
    status: wip
    on Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

docs

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions