Skip to content

Using Nodes to update existing records #81

New issue

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

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

Already on GitHub? Sign in to your account

Open
boris-42 opened this issue Jul 11, 2020 · 0 comments
Open

Using Nodes to update existing records #81

boris-42 opened this issue Jul 11, 2020 · 0 comments

Comments

@boris-42
Copy link
Contributor

Currently, this framework supports only creation of new nodes, but if we want to update some properties, manual requests are required.

As far as I understand, there are 2 approaches here, one through MERGE (to ensure that record exists and update) or MATCH (to update record only if it exists) and it's recommend to use external ids.

The proposal is to add to methods to graph:
def update(node: Node) -> MATCH+ SET
and

def ensure(node: Node) -> MERGE + SET

To do match or merge we need to have ID, which in real life is usually is some UUID from some external system. To solve this we can extend Node.__init__ to allow to pass "id_key" or "id" which will be the name of the property that is use as external id

Is community interested in this kind of change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants