Closed jknack closed 6 years ago
Hi, the following code snippet should do:
IClause[] clauses; JcQuery query; String cypher;
JcNode n = new JcNode("n");
clauses = new IClause[]{
MATCH.node(n),
WHERE.valueOf(n.property("name")).EQUALS("RIK"),
DO.SET(n.property("plays")).to("piano"),
DO.SET(n.property("age")).to(23)
};
query = new JcQuery();
query.setClauses(clauses);
cypher = print(clauses, Format.PRETTY_1);
System.out.println(cypher);
Best regards
Hi @Wolfgang-Schuetzelhofer,
I wasn't clear enough, my bad. Suppose I don't know exactly what properties are going to be updated, just got a map and want to:
This is supported by neo4j but don't see how to do it in jcypher
Hi Edgar, you can do the following: JcNode n = new JcNode("n");
clauses = new IClause[]{
MATCH.node(n),
WHERE.valueOf(n.property("name")).EQUALS("RIK"),
NATIVE.cypher("SET n = {plays: \"Piano\", age: 23}")
};
You can use the NATIVE clause whenever you want to express CYPHER that's not currently supported by JCypher. You can express arbitrary parts of a query using the NATIVE clause.
I hope that helps, best regards, Wolfgang
It does, thank you.
i think this should be in the doc
Hi,
I would like to do this:
But I can't figure it out how to do it with jcypher. Appreciate any help.
Thanks