8000 Update() destroys existing second-level relationships · Issue #211 · src-d/go-kallax · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Update() destroys existing second-level relationships #211
Closed
@nadiamoe

Description

@nadiamoe

Looks like Person.Save() saves only first level relationships, just like the README says. However, second-level relationships are destroyed if they already exist.

The most inmediate fix would be to avoid this behaviour, making Update() ignore second-level relationships instead of deleting them.

As, in most cases, one would want to change just the relationship itself and not the whole depending object, a plain Update() function may be appreciated.

In fact, I think the case where you want to edit an object and its relatives in the same operation is fairly common for insertions, but relatively rare for updates. So making this new "plain update" the default behaviour and delegating the current "full update" operation to a different method might be worth considering.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0