deem0n opened a new issue #137:
URL: https://github.com/apache/incubator-age/issues/137


   ```sql
   SELECT *
   FROM cypher('test', $$
       MATCH (v :Person)
       where id(v) = 844424930131969
       SET v.config = {first: 123, second: {a: 321}}
       RETURN v
   $$) as (v agtype);
   ERROR:  container is not an agtype array
   ```
   
   But, if you enclose map into array, then magically first element of the 
array will be used as value for the assignment:
   
   ```sql
   SELECT *
   FROM cypher('test', $$
       MATCH (v :Person)
       where id(v) = 844424930131969
       SET v.config = [{first: 1, second: {a: 3}}, , 'skipped', 'also skipped']
       RETURN v
   $$) as (v agtype);
   
   {"id": 844424930131969, "label": "Person", "properties": {"name": "Andres", 
"title": "Developer", "config": {"first": 1, "second": {"a": 3}}}}::vertex
   ```
   
   --------
   here is full log of steps:
   
   ```
   select create_graph('test');
   NOTICE:  graph "test" has been created
   ┌──────────────┐
    │ create_graph │
   ├──────────────┤
    │              │
   └──────────────┘
   (1 row)
   
   
   SELECT * 
   FROM cypher('test', $$
       CREATE (:Person {name: 'Andres', title: 'Developer', config: {first: 
123, second: {a:321}}})
   $$) as (n agtype);
   
   
   SELECT * FROM cypher('test', $$
   MATCH (v)
   RETURN v
   $$) as (v agtype);
   
   {"id": 844424930131969, "label": "Person", "properties": {"name": "Andres", 
"title": "Developer", "config": {"first": 123, "second": {"a": 321}}}}::vertex
   
   
   SELECT *
   FROM cypher('test', $$
       WITH {first: 123, second: {a: 321}} AS m
       MATCH (v :Person)
       where id(v) = 844424930131969
       SET v.config = m
       RETURN v
   $$) as (v agtype);
   
   
   
   
   SELECT *
   FROM cypher('test', $$
       WITH {first: 123, second: {a: 321}} AS m
       MATCH (v :Person)
       where id(v) = 844424930131969
       SET v.config = m
       RETURN v
   $$) as (v agtype);
   ERROR:  container is not an agtype array
   
   
   SELECT *
   FROM cypher('test', $$
       MATCH (v :Person)
       where id(v) = 844424930131969
       SET v.config = {first: 123, second: {a: 321}}
       RETURN v
   $$) as (v agtype);
   ERROR:  container is not an agtype array
   
   
   SELECT *
   FROM cypher('test', $$
       MATCH (v :Person)
       where id(v) = 844424930131969
       SET v.config = [{first: 1, second: {a: 3}}]
       RETURN v
   $$) as (v agtype);
   
   {"id": 844424930131969, "label": "Person", "properties": {"name": "Andres", 
"title": "Developer", "config": {"first": 1, "second": {"a": 3}}}}::vertex
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to