Skip to content

How do you update both a document and its embedded documents at the same time #2295

@mattg66

Description

@mattg66

Hi, I have a User model and within that an embedded phone model. I want to be able to update both the user model and the embedded phone model at the same time to maintain data integrity however the only way I have found to acheive this is to first update the parent, then update the embedded document via the $user->phone() selector? Is there a way I can combine this into one update statement?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions