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

Why neo4j doesn't support embedded attributes ? #12037

Open
vnikitch opened this issue Sep 22, 2018 · 2 comments
Open

Why neo4j doesn't support embedded attributes ? #12037

vnikitch opened this issue Sep 22, 2018 · 2 comments

Comments

@vnikitch
Copy link

Guidelines

Using neo4j-java-driver I can write:

boolean fl = session.readTransaction(new TransactionWork() {
@OverRide
public Boolean execute(Transaction tx) {
tx.run("MATCH (c:Root) WHERE ID(c) = 10 SET c.myAttr= {value}", Values.parameters("value", attrValue));
return true;
}
});

Here "attrValue" may have a type according to this article https://neo4j.com/docs/developer-manual/current/drivers/cypher-values/

But if "attrValue" is type of Map<String, Object> , I cannot perform this cypher code:
SET c.myAttr= {value}", Values.parameters("value", attrValue)

The best solution for me was to create a new node and then put there my map
tx.run("MATCH (c:Root) WHERE ID(c) = 10
MERGE (c)-[:attr {name:'map'}]->(map) SET map = {value}", Values.parameters("value", attrValue));

But this approach is not convenient as it becomes difficult to read attribute back fom neo4j to java (as I shoult find 2 nodes and relationship)

So, do you have a plan to implement embedded map attributes ?

@SaschaPeukert
Copy link
Contributor

Hej @VitaliiNikitchyn ,

Thanks for your suggestion. I will make sure that we take it into consideration in the future.

Best wishes,
Sascha Peukert

Neo4j Cypher Team

@SaschaPeukert SaschaPeukert self-assigned this Oct 1, 2018
@fickludd
Copy link
Contributor

Hi @VitaliiNikitchyn,

This is something that is on the plate for some future Neo4j version, but as there is much interesting functionality waiting to be implemented, so we do not know when we'll actually get to it.

Feel free to close the issue or leave it open as you wish.

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

4 participants