rafsun42 opened a new issue, #463:
URL: https://github.com/apache/age/issues/463

   **Is your feature request related to a problem? Please describe.**
   Currently, it is not possible to update multiple properties using `SET a += 
{...}`, although this syntax is defined in openCypher specification.
   
   **Describe the solution you'd like**
   Behavior of this syntax is expected to be similar to 
[this](https://neo4j.com/docs/cypher-manual/current/clauses/set/#set-setting-properties-using-map).
   
   Cases:
   1. A property in the provided map already exists in `properties(a)`. That 
property should be updated in `properties(a)`.
   2. A property in the provided map already exists in `properties(a)`, but its 
value in the given map is `NULL`. That property should be removed from 
`properties(a)`.
   4. A property in the provided map does not exist in `properties(a)`. That 
property should be inserted in `properties(a)`.
   
   For example,
   ```sql
   CREATE (p {name: 'Peter', age: 34})
   RETURN p;
   -- should return
   --     name = 'Peter'
   --     age = 34
   ```
   ```sql
   MATCH (p {name: 'Peter'})
   SET p += {age: 38, hungry: true, position: 'Entrepreneur'}
   RETURN p;
   -- should return
   --     name = 'Peter'
   --     age = 38
   --     hungry = true
   --     position = 'Entrepreneur'
   ```
   
   
   **Describe alternatives you've considered**
   An alternative is to update each properties separately with `=` operator.
   
   **Additional context**
   I would like to provide some implementation clues since I have already 
attempted to implement the syntax. 
   
   First of all, `cypher_clause.c` needs to be updated to support `+=` 
operator. It may be necessary to add a new member `is_add` in the type 
`cypher_update_item`, which is quite similar to `cypher_set_item`. 
   
   Finally, the `cypher_set.c` file retrieves the provided map as an `agtype` 
and `properties(a)` as an `agtype_value`. An algorithm to parse the map from 
the agtype and then merge it with the agtype_value needs to be implemented.


-- 
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