@@ -787,6 +787,11 @@ SELECT * FROM cypher('cypher_set_1', $$ CREATE (a:Robert {name:'Robert', role:'m
787787---
788788(0 rows)
789789
790+ SELECT * FROM cypher('cypher_set_1',$$CREATE (a: VertexA {map: {a: 1, b: {c: 2, d: [-100, 22, "string"]}, c: [{d: -100, e: [{f: [1, 2, 3]}]}]}, list: [1, "string", [{a: [0]}, [[1, 2]]]], bool: true, num: -1.9::numeric, str: "string"})$$) as (a agtype);
791+ a
792+ ---
793+ (0 rows)
794+
790795-- test copying properties between entities
791796SELECT * FROM cypher('cypher_set_1', $$
792797 MATCH (at {name: 'Andy'}), (pn {name: 'Peter'})
@@ -869,6 +874,47 @@ $$) AS (p agtype);
869874 {"id": 2251799813685249, "label": "Robert", "properties": {"age": 47, "city": "London", "name": "Rob"}}::vertex
870875(1 row)
871876
877+ -- test plus-equal with original properties having non-scalar values
878+ SELECT * FROM cypher('cypher_set_1', $$
879+ MATCH (p {map: {}})
880+ SET p += {json: {a: -1, b: ['a', -1, true], c: {d: 'string'}}}
881+ RETURN p
882+ $$) AS (p agtype);
883+ p
884+ -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
885+ {"id": 2533274790395905, "label": "VertexA", "properties": {"map": {"a": 1, "b": {"c": 2, "d": [-100, 22, "string"]}, "c": [{"d": -100, "e": [{"f": [1, 2, 3]}]}]}, "num": -1.9::numeric, "str": "string", "bool": true, "json": {"a": -1, "b": ["a", -1, true], "c": {"d": "string"}}, "list": [1, "string", [{"a": [0]}, [[1, 2]]]]}}::vertex
886+ (1 row)
887+
888+ SELECT * FROM cypher('cypher_set_1', $$
889+ MATCH (p {map: {}})
890+ SET p += {list_upd: [1, 2, 3, 4, 5]}
891+ RETURN p
892+ $$) AS (p agtype);
893+ p
894+ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
895+ {"id": 2533274790395905, "label": "VertexA", "properties": {"map": {"a": 1, "b": {"c": 2, "d": [-100, 22, "string"]}, "c": [{"d": -100, "e": [{"f": [1, 2, 3]}]}]}, "num": -1.9::numeric, "str": "string", "bool": true, "json": {"a": -1, "b": ["a", -1, true], "c": {"d": "string"}}, "list": [1, "string", [{"a": [0]}, [[1, 2]]]], "list_upd": [1, 2, 3, 4, 5]}}::vertex
896+ (1 row)
897+
898+ SELECT * FROM cypher('cypher_set_1', $$
899+ MATCH (p: VertexA)
900+ SET p += {int: 0}
901+ RETURN p
902+ $$) AS (p agtype);
903+ p
904+ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
905+ {"id": 2533274790395905, "label": "VertexA", "properties": {"int": 0, "map": {"a": 1, "b": {"c": 2, "d": [-100, 22, "string"]}, "c": [{"d": -100, "e": [{"f": [1, 2, 3]}]}]}, "num": -1.9::numeric, "str": "string", "bool": true, "json": {"a": -1, "b": ["a", -1, true], "c": {"d": "string"}}, "list": [1, "string", [{"a": [0]}, [[1, 2]]]], "list_upd": [1, 2, 3, 4, 5]}}::vertex
906+ (1 row)
907+
908+ SELECT * FROM cypher('cypher_set_1', $$
909+ MATCH (p {map: {}})
910+ SET p += {}
911+ RETURN p
912+ $$) AS (p agtype);
913+ p
914+ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
915+ {"id": 2533274790395905, "label": "VertexA", "properties": {"int": 0, "map": {"a": 1, "b": {"c": 2, "d": [-100, 22, "string"]}, "c": [{"d": -100, "e": [{"f": [1, 2, 3]}]}]}, "num": -1.9::numeric, "str": "string", "bool": true, "json": {"a": -1, "b": ["a", -1, true], "c": {"d": "string"}}, "list": [1, "string", [{"a": [0]}, [[1, 2]]]], "list_upd": [1, 2, 3, 4, 5]}}::vertex
916+ (1 row)
917+
872918--
873919-- Check passing mismatched types with SET
874920-- Issue 899
@@ -912,7 +958,7 @@ NOTICE: graph "cypher_set" has been dropped
912958(1 row)
913959
914960SELECT drop_graph('cypher_set_1', true);
915- NOTICE: drop cascades to 8 other objects
961+ NOTICE: drop cascades to 9 other objects
916962DETAIL: drop cascades to table cypher_set_1._ag_label_vertex
917963drop cascades to table cypher_set_1._ag_label_edge
918964drop cascades to table cypher_set_1."Andy"
@@ -921,6 +967,7 @@ drop cascades to table cypher_set_1."Kevin"
921967drop cascades to table cypher_set_1."Matt"
922968drop cascades to table cypher_set_1."Juan"
923969drop cascades to table cypher_set_1."Robert"
970+ drop cascades to table cypher_set_1."VertexA"
924971NOTICE: graph "cypher_set_1" has been dropped
925972 drop_graph
926973------------
0 commit comments