You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...
SELECT*FROM cypher('cypher_set_1', $$ CREATE (a:Andy {name:'Andy', age:36, hungry:true}) $$) AS (a agtype);
SELECT*FROM cypher('cypher_set_1', $$ CREATE (a:Peter {name:'Peter', age:34}) $$) AS (a agtype);
SELECT*FROM cypher('cypher_set_1', $$ CREATE (a:Kevin {name:'Kevin', age:32, hungry:false}) $$) AS (a agtype);
SELECT*FROM cypher('cypher_set_1', $$ CREATE (a:Matt {name:'Matt', city:'Toronto'}) $$) AS (a agtype);
SELECT*FROM cypher('cypher_set_1', $$ CREATE (a:Juan {name:'Juan', role:'admin'}) $$) AS (a agtype);
-- test copying properties between entitiesSELECT*FROM cypher('cypher_set_1', $$
MATCH (at {name: 'Andy'}), (pn {name: 'Peter'})
SET at = properties(pn)
RETURN at, pn
$$) AS (at agtype, pn agtype);
SELECT*FROM cypher('cypher_set_1', $$
MATCH (at {name: 'Kevin'}), (pn {name: 'Matt'})
SET at = pn
RETURN at, pn
$$) AS (at agtype, pn agtype);
-- test replacing all properties using a map and =SELECT*FROM cypher('cypher_set_1', $$
MATCH (m {name: 'Matt'})
SET m = {name: 'Peter Smith', position: 'Entrepreneur', city:NULL}
RETURN m
$$) AS (m agtype);
-- test removing all properties using an empty map and =SELECT*FROM cypher('cypher_set_1', $$
MATCH (p {name: 'Juan'})
SET p = {}
RETURN p
$$) AS (p agtype);
-- test assigning non-map to an enititySELECT*FROM cypher('cypher_set_1', $$
MATCH (p {name: 'Peter'})
SET p ="Peter"
RETURN p
$$) AS (p agtype);
SELECT*FROM cypher('cypher_set_1', $$
MATCH (p {name: 'Peter'})
SET p = sqrt(4)
RETURN p
$$) AS (p agtype);
...
Aside from that, two other SET syntaxes are being worked on. I will post update in this issue.
Thanks!
The text was updated successfully, but these errors were encountered:
A SET clause syntax (
SET a = {..}
) is implemented and merged recently (apache/age#468). It may be useful to add it in the documentation.The following code from the test files shows how the syntax is used. It is similar to https://neo4j.com/docs/cypher-manual/current/clauses/set/#set-copying-properties-between-nodes-and-relationships.
Aside from that, two other SET syntaxes are being worked on. I will post update in this issue.
Thanks!
The text was updated successfully, but these errors were encountered: