Skip to content
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

Cant Select Updated Node #2

Open
kapilpipaliya opened this issue Aug 11, 2022 · 4 comments
Open

Cant Select Updated Node #2

kapilpipaliya opened this issue Aug 11, 2022 · 4 comments

Comments

@kapilpipaliya
Copy link

I run this query first, it create a node:
CREATE (n:AttributesType {id: 'a'}) return n
then I update it with following query:

MATCH (n:AttributesType {id: 'a'})
SET n+={id: 'a2'}
RETURN n

now this query is returning 0 nodes, but it should return 1 node:
MATCH (n:AttributesType {id: 'a2'}) RETURN n

@kapilpipaliya
Copy link
Author

I cant replace all properties of the node:

MATCH (n:AttributesType {id: 'a'})
SET n={id: 'a2'}
RETURN n

@niclasko
Copy link
Owner

Many thanks for your comments :-)

Updating the attributes of a node with set-statement does not update the node-attribute-index (which is set when creating/merging a new node to the database). The actual attribute does change however, and you can lookup the node using a where-statement like this:
match (n) where n.id = 'a2' return n
I certainly agree that this is a shortcoming and in this case the node-attribute-index should indeed be updated as well (remove the pointer to node from the old attribute value ('a') and add a new pointer from new attribute value ('a2')). Good catch!

For your second issue (replace all properties of the node using set n={id:'a2'}), this is not implemented as I have never had a need for it, but I believe it could be useful.

Not sure when I will have the time to fix these things, but I am grateful for your valuable feedback :-)

@kapilpipaliya
Copy link
Author

Thank you very much for replying.

can you please also tell me how to delete a node?

Thanks.

@niclasko
Copy link
Owner

Hello again. Great question. Deleting nodes, relationships or properties is not implemented yet unfortunately.

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

No branches or pull requests

2 participants