-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
feat: Add GET paths for parents and children + fix: Update Neo4J query #35
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ok but I have one question:
- Changed neo4j query to disallow partial updates
Why do we want this ? Shan't it be a parameter or a specific url ?
Also if we have to push every key / values each time, we should refactor the code, because it can be done in only one query instead of so many.
@alexgarel I have now figured out a new way to tackle this. I fetch the current node information and compare it with the node object received, to remove the deleted keys. Does this make sense? |
backend/editor/entries.py
Outdated
@@ -74,9 +74,20 @@ def update_nodes(label, entry, incomingData): | |||
if not re.match(r"^\w+$", key) or key == "id": | |||
raise ValueError("Invalid key: %s", key) | |||
|
|||
# Get current node information and deleted keys | |||
curr_node = list(get_nodes(label, entry).data()[0]['n'].keys()) | |||
deleted_keys = list(set(curr_node) ^ set(incomingData)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you want to just remove keys where incoming data is null ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexgarel I added the check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a comment, but this can be ok, also like this. So fix it if you want.
What
/entry/{entry}/parents
and/entry/{entry}/children
Related issue(s)